Fixed an issue where the editor was not visible in the result grid when editing a cell with a large string. #5463

pull/5528/head
Pravesh Sharma 2022-11-14 18:51:22 +05:30 committed by GitHub
parent 19cd831225
commit e701da7390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -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 = {