Skip to content

Commit a54a21d

Browse files
Aramis13nekosaur
authored andcommitted
fix(VDataTable): revert to non locale sensitive number sort
closes #9515
1 parent cad50e2 commit a54a21d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/vuetify/src/util/helpers.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,6 @@ export function sortItems (
386386
customSorters?: Record<string, compareFn>
387387
) {
388388
if (sortBy === null || !sortBy.length) return items
389-
390-
const numericCollator = new Intl.Collator(locale, { numeric: true, usage: 'sort' })
391389
const stringCollator = new Intl.Collator(locale, { sensitivity: 'accent', usage: 'sort' })
392390

393391
return items.sort((a, b) => {
@@ -417,7 +415,7 @@ export function sortItems (
417415
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase())
418416

419417
if (sortA !== sortB) {
420-
if (!isNaN(sortA) && !isNaN(sortB)) return numericCollator.compare(sortA, sortB)
418+
if (!isNaN(sortA) && !isNaN(sortB)) return Number(sortA) - Number(sortB)
421419
return stringCollator.compare(sortA, sortB)
422420
}
423421
}

0 commit comments

Comments
 (0)