Skip to content

Commit 518231c

Browse files
authored
Update mixin-sorting.js
1 parent 82728ff commit 518231c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/table/helpers/mixin-sorting.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,16 +266,20 @@ export default {
266266
// handle toggling on the index
267267
if (key === sortBy) {
268268
// Change sorting direction on current column
269-
this.localSortDesc[0] = !this.localSortDesc[0]
269+
// this.localSortDesc[0] = !this.localSortDesc[0]
270+
this.localSortDesc = [!this.localSortDesc[0]]
271+
// TODO in this PR:
272+
// Check if sort is clearing (third click), and
273+
// if so remove the sort item from both localSortBy/localSortDesc
270274
} else {
271275
// Start sorting this column ascending
272276
this.localSortBy[0] = key
273277
// this.localSortDesc = false
274278
toggleLocalSortDesc()
275279
}
276280
sortChanged = true
277-
} else if (this.localSortBy && !this.noSortReset) {
278-
this.localSortBy = ['']
281+
} else if (this.localSortBy.length > 0 && !this.noSortReset) {
282+
this.localSortBy = []
279283
toggleLocalSortDesc()
280284
sortChanged = true
281285
// } else {

0 commit comments

Comments
 (0)