Skip to content

Commit

Permalink
return new array instead of modifiying existing for natural sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergej-Vlasov committed Jan 2, 2025
1 parent 8aee465 commit 8cc08a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/scenes/src/variables/variants/query/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function sortByNumeric(opt: VariableValueOption) {
const collator = new Intl.Collator(undefined, { sensitivity: 'accent', numeric: true });

function sortByNaturalSort(options: VariableValueOption[]) {
return options.sort((a, b) => {
return options.slice().sort((a, b) => {
return collator.compare(a.label, b.label);
});
}

0 comments on commit 8cc08a9

Please sign in to comment.