File tree 1 file changed +7
-3
lines changed
src/components/table/helpers
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -266,16 +266,20 @@ export default {
266
266
// handle toggling on the index
267
267
if ( key === sortBy ) {
268
268
// 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
270
274
} else {
271
275
// Start sorting this column ascending
272
276
this . localSortBy [ 0 ] = key
273
277
// this.localSortDesc = false
274
278
toggleLocalSortDesc ( )
275
279
}
276
280
sortChanged = true
277
- } else if ( this . localSortBy && ! this . noSortReset ) {
278
- this . localSortBy = [ '' ]
281
+ } else if ( this . localSortBy . length > 0 && ! this . noSortReset ) {
282
+ this . localSortBy = [ ]
279
283
toggleLocalSortDesc ( )
280
284
sortChanged = true
281
285
// } else {
You can’t perform that action at this time.
0 commit comments