Skip to content

Commit b5a8058

Browse files
authored
Update mixin-sorting.js
1 parent 69fc8f7 commit b5a8058

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,16 @@ export default {
109109
},
110110
computedSortDesc() {
111111
// Ensure values are tri-state (true, false, null), and same length as localSortBy array
112-
const sortDesc = this.localSortDesc
113-
return this.computedSortBy.map((_, idx) => (isBoolean(sortDesc[idx]) ? sortDesc[idx] : null))
112+
let sortDesc = this.localSortDesc
113+
sortDesc = this.computedSortBy.map((_, idx) => (isBoolean(sortDesc[idx]) ? sortDesc[idx] : null))
114+
return this.sortMulti ? sortDesc : sortDesc.slice(0, 1)
114115
},
115116
computedSortInfo() {
116117
// TODO in this PR:
117118
// Make sortInfo a data property which we update
118119
// via watchers on sortBy/SortDesc and event handlers.
119120
// When a column is no longer sorted (null) we remove it from the array
120-
return this.computedSortBy
121+
return this.localSortBy
121122
.map((key, idx) => {
122123
const field = this.computedFieldsObj[key] || {}
123124
return {

0 commit comments

Comments
 (0)