diff --git a/src/components/PhotoPage/SelectControlSingleValue.js b/src/components/PhotoPage/SelectControlSingleValue.js index 1f5595e..b31b886 100644 --- a/src/components/PhotoPage/SelectControlSingleValue.js +++ b/src/components/PhotoPage/SelectControlSingleValue.js @@ -15,6 +15,7 @@ import Chip from '@material-ui/core/Chip'; import MenuItem from '@material-ui/core/MenuItem'; import CancelIcon from '@material-ui/icons/Cancel'; import { emphasize } from '@material-ui/core/styles/colorManipulator'; +import _ from 'lodash'; import { getValueFromTree } from '../../utils'; @@ -245,9 +246,12 @@ class SelectControlSingleValue extends React.Component { } initializeOptions = (data) => { - const options = Object + const unsortedOptions = Object .entries(data) .map(([key,value]) => ({label: value.label, key: value.key })); + + const options = _.sortBy(unsortedOptions, "label"); + this.options = options; this.setState({ options }); }