Skip to content

Commit

Permalink
Fix VuiTable row selection bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Nov 9, 2023
1 parent 0330469 commit b690086
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/components/table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ export const VuiTable = <T extends Row>({
selectedIds[rowId] = true;
}

onSelectRow(Object.keys(selectedIds).map((id) => rows.find((row) => rowId === id) as T));
const selectedRowIds = Object.keys(selectedIds);
// Map selected row IDs to selected rows.
const selectedRows = selectedRowIds.map((id) => rows.find((row) => row.id === id) as T);
onSelectRow(selectedRows);
}}
/>
</VuiTableCell>
Expand Down

0 comments on commit b690086

Please sign in to comment.