Skip to content

Commit

Permalink
Change sorting of options to be based on size of option
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Hermosilla <[email protected]>
  • Loading branch information
rezen committed Feb 26, 2021
1 parent b18beab commit ab63734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ document.addEventListener("DOMContentLoaded", function() {
Object.entries(widget.options).map(pair => {
const [idx, el] = pair;
const opts = [...new Set(el._options)];
opts.sort();
opts.sort((a, b) => a.length - b.length);
opts.map(o => {
const ol = document.createElement('option');
ol.innerText = o;
Expand Down

0 comments on commit ab63734

Please sign in to comment.