Skip to content

Commit

Permalink
Merge pull request #17222 from PrashantMangukiya/prashant-17080
Browse files Browse the repository at this point in the history
Sort state list alphabetically
  • Loading branch information
bondydaa authored Apr 10, 2023
2 parents c31a259 + 6ea5285 commit ca8886a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/StatePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const defaultProps = {
};

const StatePicker = forwardRef((props, ref) => {
const STATES = _.map(props.translate('allStates'), ({stateISO, stateName}) => ({
value: stateISO,
label: stateName,
}));
const STATES = _.chain(props.translate('allStates'))
.sortBy(state => state.stateName.toLowerCase())
.map(state => ({value: state.stateISO, label: state.stateName}))
.value();

return (
<Picker
Expand Down

0 comments on commit ca8886a

Please sign in to comment.