You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
optionsSorting not working for numeric values #2277
The object is parsed from JSON, so it is not possible for me to use numeric keys directly.
I expected that the options would be sorted from highest numeric values to lowest numeric values in the dropdown of the create.and edit forms. However, this is not the case. The options get sorted by value (so 1, 5, 7, etc.), but the values are treated as string values. Instead of a numerically descending order, the options are sorted in the lexicographic order, resulting in:
99, 98, 97, 96, 16, 15, 13, 103, 102, ...
Activity
liedekef commentedon Dec 26, 2024
This solution has been added to my fork, I agree :-)
misterparsons commentedon Apr 7, 2025
Thanks for sharing, quickly solved a problem for me.