We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When sorting the an array of string values 11, 1A and 2A, one expects the order to be: 11 1A 2A
This is in compliance with the default string sort in javascript:
const values = ['1A','2A','11']; const sorted = values.sort((a, b) => { return a.localeCompare(b); }); console.dir(JSON.stringify(sorted)); //["11","1A","2A"]
However, when sorting with column in Datatable, the sequence becomes: 1A 2A 11
It seems like Datatable uses Intl.Collator with numeric=true for sorting. This yields incorrect sort order for alphanumeric strings.
No response
https://stackblitz.com/edit/attxsqgh-g42npo1p?file=src%2FApp.vue
Stackblitz
3.2.45
4.2.5
Run the stackblitz. Click on the column header to sort. Verify incorrect sort order.
Sort it in the following order: 11 1A 2A
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
When sorting the an array of string values 11, 1A and 2A, one expects the order to be:
11
1A
2A
This is in compliance with the default string sort in javascript:
However, when sorting with column in Datatable, the sequence becomes:
1A
2A
11
It seems like Datatable uses Intl.Collator with numeric=true for sorting. This yields incorrect sort order for alphanumeric strings.
Pull Request Link
No response
Reason for not contributing a PR
Other Reason
No response
Reproducer
https://stackblitz.com/edit/attxsqgh-g42npo1p?file=src%2FApp.vue
Environment
Stackblitz
Vue version
3.2.45
PrimeVue version
4.2.5
Node version
No response
Browser(s)
No response
Steps to reproduce the behavior
Run the stackblitz. Click on the column header to sort.
Verify incorrect sort order.
Expected behavior
Sort it in the following order:
11
1A
2A
The text was updated successfully, but these errors were encountered: