TableNG: Use numeric sorting for string fields (not strictly lexicographic) (#103794)
This commit is contained in:
@@ -515,7 +515,9 @@ export interface MapFrameToGridOptions extends TableNGProps {
|
||||
}
|
||||
|
||||
/* ----------------------------- Data grid comparator ---------------------------- */
|
||||
const compare = new Intl.Collator('en', { sensitivity: 'base' }).compare;
|
||||
// The numeric: true option is used to sort numbers as strings correctly. It recognizes numeric sequences
|
||||
// within strings and sorts numerically instead of lexicographically.
|
||||
const compare = new Intl.Collator('en', { sensitivity: 'base', numeric: true }).compare;
|
||||
export function getComparator(sortColumnType: FieldType): Comparator {
|
||||
switch (sortColumnType) {
|
||||
case FieldType.time:
|
||||
|
||||
Reference in New Issue
Block a user