Skip to content

Commit

Permalink
fix: data table checkboxes and sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
hperrin committed Sep 14, 2021
1 parent 048a11d commit e88a19c
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/chips/Text.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:mount', accessor);
return () => {
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:unmount');
dispatch(getElement(), 'SMUIChipsChipPrimaryAction:unmount', accessor);
};
});
Expand Down
2 changes: 1 addition & 1 deletion packages/chips/TrailingAction.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
instance.init();
return () => {
dispatch(getElement(), 'SMUIChipsChipTrailingAction:unmount');
dispatch(getElement(), 'SMUIChipsChipTrailingAction:unmount', accessor);
instance.destroy();
};
Expand Down
4 changes: 2 additions & 2 deletions packages/data-table/Body.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
},
};
dispatch(getElement(), 'SMUI:data-table:body:mount', accessor);
dispatch(getElement(), 'SMUIDataTableBody:mount', accessor);
return () => {
dispatch(getElement(), 'SMUI:data-table:body:unmount');
dispatch(getElement(), 'SMUIDataTableBody:unmount', accessor);
};
});
Expand Down
2 changes: 1 addition & 1 deletion packages/data-table/Cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
dispatch(getElement(), 'SMUIDataTableCell:mount', accessor);
return () => {
dispatch(getElement(), 'SMUIDataTableCell:unmount');
dispatch(getElement(), 'SMUIDataTableCell:unmount', accessor);
};
});
Expand Down
6 changes: 4 additions & 2 deletions packages/data-table/DataTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,12 @@
'.mdc-data-table__header-cell--with-sort'
) as HTMLTableCellElement;
if (!headerCell) {
return;
if (headerCell) {
handleSortAction(headerCell);
}
}
function handleSortAction(headerCell: HTMLTableCellElement) {
const orderedCells = header?.orderedCells ?? [];
const columnIndex = orderedCells
Expand Down
4 changes: 2 additions & 2 deletions packages/data-table/Head.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
},
};
dispatch(getElement(), 'SMUI:data-table:header:mount', accessor);
dispatch(getElement(), 'SMUIDataTableHeader:mount', accessor);
return () => {
dispatch(getElement(), 'SMUI:data-table:header:unmount');
dispatch(getElement(), 'SMUIDataTableHeader:unmount', accessor);
};
});
Expand Down
2 changes: 1 addition & 1 deletion packages/data-table/Row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
dispatch(getElement(), 'SMUIDataTableRow:mount', accessor);
return () => {
dispatch(getElement(), 'SMUIDataTableRow:unmount');
dispatch(getElement(), 'SMUIDataTableRow:unmount', accessor);
};
});
Expand Down
2 changes: 1 addition & 1 deletion packages/site/src/routes/demo/dialog/_List.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<Button on:click={() => (open = true)}><Label>Open Dialog</Label></Button>

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

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

0 comments on commit e88a19c

Please sign in to comment.