Skip to content

Commit 1629645

Browse files
Preserve onRowSelectionChange tanstack feature (#1110)
Allow hoisting up of row selection state by calling the prop callback after internal state updates, following the same pattern used for onSortingChange and onColumnFiltersChange. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 643955f commit 1629645

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/hooks/use-data-grid.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1932,8 +1932,10 @@ function useDataGrid<TData>({
19321932
store.setState("focusedCell", null);
19331933
store.setState("editingCell", null);
19341934
});
1935+
1936+
propsRef.current.onRowSelectionChange?.(updater);
19351937
},
1936-
[store, columnIds],
1938+
[store, columnIds, propsRef],
19371939
);
19381940

19391941
const onRowSelect = React.useCallback(

0 commit comments

Comments
 (0)