Skip to content

Commit d73314d

Browse files
committed
Don't show the editor if there isn't one
1 parent b76838b commit d73314d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/DataGrid.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,13 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
705705
return;
706706
}
707707

708-
if (isCellEditable(selectedPosition) && isDefaultCellInput(event, onCellPaste != null)) {
708+
const column = columns[selectedPosition.idx];
709+
710+
if (
711+
isCellEditable(selectedPosition) &&
712+
column.renderEditCell != null &&
713+
isDefaultCellInput(event, onCellPaste != null)
714+
) {
709715
setSelectedPosition(({ idx, rowIdx }) => ({
710716
idx,
711717
rowIdx,
@@ -834,7 +840,8 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
834840

835841
const samePosition = isSamePosition(selectedPosition, position);
836842

837-
if (options?.enableEditor && isCellEditable(position)) {
843+
const column = columns[selectedPosition.idx];
844+
if (options?.enableEditor && isCellEditable(position) && column.renderEditCell != null) {
838845
const row = rows[position.rowIdx];
839846
setSelectedPosition({ ...position, mode: 'EDIT', row, originalRow: row });
840847
} else if (samePosition) {

0 commit comments

Comments
 (0)