Skip to content

Commit e88a19c

Browse files
committed
fix: data table checkboxes and sorting
1 parent 048a11d commit e88a19c

File tree

8 files changed

+13
-11
lines changed

8 files changed

+13
-11
lines changed

packages/chips/Text.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:mount', accessor);
7575
7676
return () => {
77-
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:unmount');
77+
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:unmount', accessor);
7878
};
7979
});
8080

packages/chips/TrailingAction.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
instance.init();
107107
108108
return () => {
109-
dispatch(getElement(), 'SMUIChipsChipTrailingAction:unmount');
109+
dispatch(getElement(), 'SMUIChipsChipTrailingAction:unmount', accessor);
110110
111111
instance.destroy();
112112
};

packages/data-table/Body.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
},
5252
};
5353
54-
dispatch(getElement(), 'SMUI:data-table:body:mount', accessor);
54+
dispatch(getElement(), 'SMUIDataTableBody:mount', accessor);
5555
5656
return () => {
57-
dispatch(getElement(), 'SMUI:data-table:body:unmount');
57+
dispatch(getElement(), 'SMUIDataTableBody:unmount', accessor);
5858
};
5959
});
6060

packages/data-table/Cell.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
dispatch(getElement(), 'SMUIDataTableCell:mount', accessor);
145145
146146
return () => {
147-
dispatch(getElement(), 'SMUIDataTableCell:unmount');
147+
dispatch(getElement(), 'SMUIDataTableCell:unmount', accessor);
148148
};
149149
});
150150

packages/data-table/DataTable.svelte

+4-2
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,12 @@
318318
'.mdc-data-table__header-cell--with-sort'
319319
) as HTMLTableCellElement;
320320
321-
if (!headerCell) {
322-
return;
321+
if (headerCell) {
322+
handleSortAction(headerCell);
323323
}
324+
}
324325
326+
function handleSortAction(headerCell: HTMLTableCellElement) {
325327
const orderedCells = header?.orderedCells ?? [];
326328
327329
const columnIndex = orderedCells

packages/data-table/Head.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@
5151
},
5252
};
5353
54-
dispatch(getElement(), 'SMUI:data-table:header:mount', accessor);
54+
dispatch(getElement(), 'SMUIDataTableHeader:mount', accessor);
5555
5656
return () => {
57-
dispatch(getElement(), 'SMUI:data-table:header:unmount');
57+
dispatch(getElement(), 'SMUIDataTableHeader:unmount', accessor);
5858
};
5959
});
6060

packages/data-table/Row.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
dispatch(getElement(), 'SMUIDataTableRow:mount', accessor);
9494
9595
return () => {
96-
dispatch(getElement(), 'SMUIDataTableRow:unmount');
96+
dispatch(getElement(), 'SMUIDataTableRow:unmount', accessor);
9797
};
9898
});
9999

packages/site/src/routes/demo/dialog/_List.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<Button on:click={() => (open = true)}><Label>Open Dialog</Label></Button>
2525

2626
<pre
27-
class="status">Clicked: {clicked}{clicked === 69 ? ', nice' : clicked === 42 ? ', life, the universe, and everything' : ''}</pre>
27+
class="status">Clicked: {clicked}{clicked === 69 ? ', nice' : clicked === 42 ? ', the answer to life, the universe, and everything' : ''}</pre>
2828

2929
<script lang="ts">
3030
import Dialog, { Title, Content } from '@smui/dialog';

0 commit comments

Comments
 (0)