From e701da739031ed985af7b0d8254669ecd54aa78f Mon Sep 17 00:00:00 2001 From: Pravesh Sharma Date: Mon, 14 Nov 2022 18:51:22 +0530 Subject: [PATCH] Fixed an issue where the editor was not visible in the result grid when editing a cell with a large string. #5463 --- .../static/js/components/QueryToolDataGrid/Editors.jsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx index 836058337..eee49a73c 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/Editors.jsx @@ -129,16 +129,20 @@ function setEditorPosition(cellEle, editorEle) { } let gridEle = cellEle.closest('.rdg'); let cellRect = cellEle.getBoundingClientRect(); + let gridEleRect = gridEle.getBoundingClientRect(); let position = { left: cellRect.left, top: Math.max(cellRect.top - editorEle.offsetHeight + 12, 0) }; if ((position.left + editorEle.offsetWidth + 10) > gridEle.offsetWidth) { - position.left -= position.left + editorEle.offsetWidth - gridEle.offsetWidth + 10; + position.left -= position.left + editorEle.offsetWidth - gridEle.offsetWidth + 10; } - editorEle.style.left = position.left + 'px'; - editorEle.style.top = position.top + 'px'; + if (cellRect.left < gridEleRect.left) { + position.left = gridEleRect.left + 10; + } + editorEle.style.left = `${position.left}px`; + editorEle.style.top = `${position.top}px`; } const EditorPropTypes = {