Skip to content

Commit

Permalink
display countries dropdown in alphabetic order
Browse files Browse the repository at this point in the history
  • Loading branch information
batzionb committed Nov 21, 2024
1 parent ae1c3b5 commit 361fd81
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const CountryWidget: Widget<JsonObject, JSONSchema7, any> = ({ value, onChange }
const countryOptions: Option[] = data.map((country: any) => ({
label: country.name.common,
value: country.name.common,
}));
})).sort(({label: label1}, {label: label2}) => label1.localeCompare(label2));
setCountries(countryOptions);
} catch (err) {
// eslint-disable-next-line no-alert
Expand Down

0 comments on commit 361fd81

Please sign in to comment.