mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Merge pull request #188 from mabentley85/include-sort-direction-in-datatable-click-header-dispatch
Added the Sort Direction to the header click dispatch
This commit is contained in:
commit
44c861a002
1 changed files with 1 additions and 1 deletions
|
@ -79,10 +79,10 @@
|
||||||
<TableHeader
|
<TableHeader
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
dispatch('click', { header });
|
dispatch('click', { header });
|
||||||
dispatch('click:header', header);
|
|
||||||
let active = header.key === $sortHeader.key;
|
let active = header.key === $sortHeader.key;
|
||||||
let currentSortDirection = active ? $sortHeader.sortDirection : 'none';
|
let currentSortDirection = active ? $sortHeader.sortDirection : 'none';
|
||||||
let sortDirection = sortDirectionMap[currentSortDirection];
|
let sortDirection = sortDirectionMap[currentSortDirection];
|
||||||
|
dispatch('click:header', {header, sortDirection});
|
||||||
sortHeader.set({
|
sortHeader.set({
|
||||||
id: sortDirection === 'none' ? null : $thKeys[header.key],
|
id: sortDirection === 'none' ? null : $thKeys[header.key],
|
||||||
key: header.key,
|
key: header.key,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue