Skip to content

Commit

Permalink
fix(EnumProperty): Allow sorted listing
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed May 24, 2018
1 parent 56a32e3 commit 1fbb415
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Common/Misc/ConvertProxyProperty/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export function proxyPropToProp(property, ui) {
domain: ui.domain || extractDomain(ui),
componentLabels: [],
size: extractSize(ui),
sort: ui.sort,
},
data: {
id: [property.id, property.name].join(':'),
Expand Down
7 changes: 6 additions & 1 deletion src/React/Properties/EnumProperty/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ export default class EnumProperty extends React.Component {
ret.push(<option key="empty-value" value={null} />);
}

Object.keys(this.props.ui.domain).forEach((key) => {
const keys = Object.keys(this.props.ui.domain);
if (this.props.ui.sort) {
keys.sort();
}

keys.forEach((key) => {
ret.push(
<option
value={valueToString(this.props.ui.domain[key])}
Expand Down

0 comments on commit 1fbb415

Please sign in to comment.