Skip to content
Snippets Groups Projects
Commit 2b24189c authored by Tom Robinson's avatar Tom Robinson
Browse files

Don't sort numeric field values lexically

parent 2273d13e
No related branches found
No related tags found
No related merge requests found
......@@ -143,7 +143,8 @@ function equivalentArgument(field, table) {
if (isCategory(field)) {
if (field.id in table.field_values && table.field_values[field.id].length > 0) {
let validValues = table.field_values[field.id];
validValues.sort();
// this sort function works for both numbers and strings:
validValues.sort((a, b) => a === b ? 0 : (a < b ? -1 : 1));
return {
type: "select",
values: validValues
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment