Open javve opened 8 years ago
"ü" is before "y"; in descending order
hello,
The sorting order fails on this case : http://codepen.io/anon/pen/VaKgZB Two almost identical values, but one with a number a the end.
@laudeon Thanks that i am not alone. Sorting fails for me in exact the same way. I am no javascript guru, i have no idea what is going wrong there. Any advice?
Having the same issue.
http://codepen.io/CBeloch/pen/RaLepP
It works when I rename the "PlayStation" to "PlayStation 1".
The naturalSort
fails because the normChunk
method gets undefined
as the first parameter.
I fixed it by adding
if (!s) {
return 0;
}
at the beginning
Pull request hast been submitted
The sorting fails when the search variable contains mixed cyrilics (unicode?) and digits. Let's say, we have four values: RA1, RA2, ЗЫ1, ЗЫ2. First two are sorted correctly, second two do not sort at all. By the way, cyrillics without numbers is sorted well: for example, { Мартина, Густав } (Martina, Gustav) sorted correctly though. Codepen: http://codepen.io/anon/pen/qawvNm Now I'm trying to narrow the bug.
BTW, I found an error:
if (/[^\x00-\x80]/.test(oFxNcL + oFyNcL) && oFxNcL.localeCompare) {
var comp = oFxNcL.localeCompare(oFyNcL);
return comp / Math.abs(comp);
}
If both Unicode strings are equal, comp = 0, so we return 0/0. Also there's error should not set zero on this level, so we add if. As the localeCompare method returns either -1, 0 or 1, we don't need division, so the code shoud be, it seems,
if (/[^\x00-\x80]/.test(oFxNcL + oFyNcL) && oFxNcL.localeCompare) {
var comp = oFxNcL.localeCompare(oFyNcL);
if (comp !== 0) return comp;
}
Please check my solution.
Hi I'm having a number sorting issue... I have hundreds of values e.g. 1.23; -0.23, 0.02 etc But the out of the box sorting doesn't seem to handle it... Any thoughts?
The site is here: https://www.biopharmcatalyst.com/companies/company-pipeline-database (hit the change
th)
We're using data attributes to apply the sort.
I'm adding this issue as a collection of all sorting order related issues.