Skip to content

Commit

Permalink
fix(DataTable): allow removal of additional sortings (#20990)
Browse files Browse the repository at this point in the history
fixes #20985
  • Loading branch information
KYash03 authored Feb 17, 2025
1 parent 6d957d3 commit 32e5747
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ export function provideSort (options: {
const item = newSortBy.find(x => x.key === column.key)

if (!item) {
if (multiSort.value) newSortBy = [...newSortBy, { key: column.key, order: 'asc' }]
else newSortBy = [{ key: column.key, order: 'asc' }]
if (multiSort.value) {
newSortBy.push({ key: column.key, order: 'asc' })
} else {
newSortBy = [{ key: column.key, order: 'asc' }]
}
} else if (item.order === 'desc') {
if (mustSort.value) {
if (mustSort.value && newSortBy.length === 1) {
item.order = 'asc'
} else {
newSortBy = newSortBy.filter(x => x.key !== column.key)
Expand Down

0 comments on commit 32e5747

Please sign in to comment.