mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
Use store $ assignment to fix batch selection
Without the `=` sign, the reactivity chain were broken. Using an assignment by prefixing the store with a `$` fixes this. https://svelte.dev/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values
This commit is contained in:
parent
c2568ec5d4
commit
962202ccd6
1 changed files with 8 additions and 10 deletions
|
@ -195,16 +195,14 @@
|
|||
$: if (radio || batchSelection) selectable = true;
|
||||
$: tableSortable.set(sortable);
|
||||
$: headerKeys = headers.map(({ key }) => key);
|
||||
$: tableRows.set(
|
||||
rows.map((row) => ({
|
||||
...row,
|
||||
cells: headerKeys.map((key, index) => ({
|
||||
key,
|
||||
value: resolvePath(row, key),
|
||||
display: headers[index].display,
|
||||
})),
|
||||
}))
|
||||
);
|
||||
$: $tableRows = rows.map((row) => ({
|
||||
...row,
|
||||
cells: headerKeys.map((key, index) => ({
|
||||
key,
|
||||
value: resolvePath(row, key),
|
||||
display: headers[index].display,
|
||||
})),
|
||||
}));
|
||||
$: sortedRows = [...$tableRows];
|
||||
$: ascending = $sortHeader.sortDirection === "ascending";
|
||||
$: sortKey = $sortHeader.key;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue