Skip to content

Commit

Permalink
fix(Datagrid): onRowClick results in toggleRow.toggleRowSelected is n…
Browse files Browse the repository at this point in the history
…ot a function error in console (#6633)

* fix: add null check for callback

* Update packages/ibm-products/src/components/Datagrid/useOnRowClick.ts

Co-authored-by: Alexander Melo <[email protected]>

* fix: format change

---------

Co-authored-by: Alexander Melo <[email protected]>
  • Loading branch information
amal-k-joy and AlexanderMelox authored Jan 13, 2025
1 parent 9f651fe commit 82ce15c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const useOnRowClick = (hooks: Hooks) => {
if (!withSelectRows) {
instance.selectedFlatRows &&
instance.selectedFlatRows.map((toggleRow) =>
toggleRow.toggleRowSelected(false)
toggleRow.toggleRowSelected?.(false)
);
toggleRowSelected(id, true);
}
Expand Down

0 comments on commit 82ce15c

Please sign in to comment.