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

Feature Request: Make sortChildren locale-aware #1168

Open
flack opened this issue Nov 13, 2024 · 0 comments
Open

Feature Request: Make sortChildren locale-aware #1168

flack opened this issue Nov 13, 2024 · 0 comments

Comments

@flack
Copy link
Contributor

flack commented Nov 13, 2024

Expected and Actual Behavior

When I call node.sortChildren(null, true) on some entries with umlauts, I get the following result

Screenshot_20241113_173542

what I would like to get is this:

Screenshot_20241113_173507

It is actually very simple to achieve, I just need to change my code to look like this:

node.sortChildren(function(a, b) {
    return a.localeCompare(b);
}, true);

But I was wondering if it wouldn't be better if this was the default behavior, probably it would be enough to change this one line to use localeCompare instead:

return x === y ? 0 : x > y ? 1 : -1;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants