Skip to content

Commit 906d2bf

Browse files
committed
fix: resolve cell editing state overriding bug
1 parent 08da2c0 commit 906d2bf

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

‎lib/components/DataGrid/DataGrid.tsx‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ export function DataGrid<R extends GridRowModel = GridRowModel>(props: DataGridP
315315
});
316316

317317
const editingHandlers = useGridEditing({
318-
rows,
319-
getRowId: (row) => row.id,
318+
rows: effectiveRows,
319+
getRowId: effectiveGetRowId,
320320
processRowUpdate,
321321
onProcessRowUpdateError,
322322
onRowChange: (updatedRow) => {
@@ -604,11 +604,8 @@ export function DataGrid<R extends GridRowModel = GridRowModel>(props: DataGridP
604604
]);
605605

606606
const baseRows = useMemo(() => {
607-
if (dataSource) {
608-
return Array.from(state.rows.idRowsLookup.values()) as R[];
609-
}
610-
return activeRows;
611-
}, [dataSource, state.rows.idRowsLookup, activeRows]);
607+
return effectiveRows;
608+
}, [effectiveRows]);
612609

613610
const filteredRows = useMemo(() => {
614611
if (activeHierarchyHandlers) {

0 commit comments

Comments
 (0)