Skip to content

Commit 1ceb853

Browse files
authored
Validate position before rendering editor (Comcast#3849)
1 parent 6c51d7e commit 1ceb853

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/DataGrid.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,13 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
10021002
}
10031003

10041004
function getCellEditor(rowIdx: number) {
1005-
if (selectedPosition.rowIdx !== rowIdx || selectedPosition.mode === 'SELECT') return;
1005+
if (
1006+
!isCellWithinViewportBounds(selectedPosition) ||
1007+
selectedPosition.rowIdx !== rowIdx ||
1008+
selectedPosition.mode === 'SELECT'
1009+
) {
1010+
return;
1011+
}
10061012

10071013
const { idx, row } = selectedPosition;
10081014
const column = columns[idx];

0 commit comments

Comments
 (0)