Skip to content

Commit acf3cf8

Browse files
committed
Use the new prop
1 parent c7f254a commit acf3cf8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/DataGrid.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,7 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
904904
const { idx, row } = selectedPosition;
905905
const column = columns[idx];
906906
const colSpan = getColSpan(column, lastFrozenColumnIndex, { type: 'ROW', row });
907+
const discardOnRowChange = column.editorOptions?.discardOnRowChange !== false;
907908

908909
const closeEditor = (shouldFocusCell: boolean) => {
909910
setShouldFocusCell(shouldFocusCell);
@@ -925,7 +926,7 @@ export function DataGrid<R, SR = unknown, K extends Key = Key>(props: DataGridPr
925926
}
926927
};
927928

928-
if (rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) {
929+
if (discardOnRowChange && rows[selectedPosition.rowIdx] !== selectedPosition.originalRow) {
929930
// Discard changes if rows are updated from outside
930931
closeEditor(false);
931932
}

0 commit comments

Comments
 (0)