Skip to content
New issue

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

[Bug Report] Data Table Sorting Wrong #9515

Closed
24jr opened this issue Oct 30, 2019 · 8 comments · Fixed by socialsoftware/quizzes-tutor#52, socialsoftware/quizzes-tutor#55 or drakeg/vue_learn#9
Assignees
Labels
C: VData S: has PR The issue has a pending Pull Request T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke

Comments

@24jr
Copy link

24jr commented Oct 30, 2019

Environment

Vuetify Version: 2.1.7
Last working version: 2.1.6
Vue Version: 2.6.10
Browsers: Google Chrome, Safari 13.0.2
OS: Mac OS 10.14.6

Steps to reproduce

Just sort the columns from header

Expected Behavior

Sorts high negative to zero to high positive. Also scientific notation sort by actual values not the leading scientific notation value

Actual Behavior

sorts low neg to high neg then low pos to high pos

Reproduction Link

https://codepen.io/24jr/pen/BaawddR

@ghost ghost added the S: triage label Oct 30, 2019
@jacekkarczmarczyk
Copy link
Member

43adae8

@jacekkarczmarczyk jacekkarczmarczyk added C: VData T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke and removed S: triage labels Oct 30, 2019
@nekosaur nekosaur self-assigned this Oct 30, 2019
@nekosaur
Copy link
Member

ping @Aramis13

@Aramis13
Copy link
Contributor

Sure. I'm on it.
Which branch to work on?

@nekosaur
Copy link
Member

master

@Aramis13
Copy link
Contributor

👍

@Aramis13
Copy link
Contributor

Aramis13 commented Nov 1, 2019

So after some research theirs a few issues:

  • Intl.Collator numeric does not take in to account negative numbers and has troubles with decimal numbers.

  • The isNaN() or Number.isNaN() functions does not work with number formats except 0-9.

  • Intl.Collator numeric does manage to sort according to locale (Excluding negative and decimal numbers), but i didn't found any off the shelf solution for detecting if unique locales string isNaN.

Possible solutions:

  1. Revert to use Number(sortA) - Number(sortB), This solution wont take in to consideration number formats except 0-9.

  2. Implement some util function that convert unique locale numeric formats to 0-9 format.

Any thoughts?

@nekosaur
Copy link
Member

nekosaur commented Nov 1, 2019

My initial thought is to revert to the old behavior for numbers, since it's been in place for a long time without issue.

@timothymarois
Copy link

I found this issue too and updated from 2.1.9 to 2.1.11 and the sorting has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VData S: has PR The issue has a pending Pull Request T: bug Functionality that does not work as intended/expected T: regression Something that used to work but we broke
Projects
None yet
5 participants