Skip to content

Commit 04930e0

Browse files
committed
fix: CDataTable: make item sorting case insensitive
1 parent 041d345 commit 04930e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/table/CDataTable.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,11 @@ export default {
353353
354354
//if values in column are to be sorted by numeric value they all have to be type number
355355
const flip = this.sorterState.asc ? 1 : -1
356-
return this.tableFiltered.slice().sort((item , item2) => {
356+
return this.tableFiltered.slice().sort((item, item2) => {
357357
const value = item[col]
358358
const value2 = item2[col]
359-
const a = typeof value === 'number' ? value : String(value)
360-
const b = typeof value2 === 'number' ? value2 : String(value2)
359+
const a = typeof value === 'number' ? value : String(value).toLowerCase()
360+
const b = typeof value2 === 'number' ? value2 : String(value2).toLowerCase()
361361
return a > b ? 1 * flip : b > a ? -1 * flip : 0
362362
})
363363
},

0 commit comments

Comments
 (0)