Skip to content

Commit

Permalink
[DataGrid] Prevent error when deleting the last row (mui#15146)
Browse files Browse the repository at this point in the history
Signed-off-by: Deepak Maurya <[email protected]>
  • Loading branch information
dpak-maurya authored and KenanYusuf committed Oct 28, 2024
1 parent 6c24619 commit 955b3f7
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export const useGridFocus = (

const nextRow =
currentPage.rows[clamp(lastFocusedRowIndex, 0, currentPage.rows.length - 1)];
nextRowId = nextRow.id ?? null;
nextRowId = nextRow?.id ?? null;
}

apiRef.current.setState((state) => ({
Expand Down

0 comments on commit 955b3f7

Please sign in to comment.