diff --git a/src/container/property-list/property-list.tsx b/src/container/property-list/property-list.tsx index 49dacaa48..d8f497e42 100644 --- a/src/container/property-list/property-list.tsx +++ b/src/container/property-list/property-list.tsx @@ -37,6 +37,13 @@ class PropertyViewContainer extends React.Component this.props.property.setValue(target.checked); } + private handleEnumChange(e: React.ChangeEvent): void { + const patternProperty = this.props.property.getPatternProperty() as PatternEnumProperty; + const selectedOption = patternProperty.getOptionById(e.target.value); + const selectedValue = selectedOption ? selectedOption.getValue() : undefined; + this.props.property.setValue(selectedValue); + } + private handleInputChange(e: React.ChangeEvent): void { this.props.property.setValue(e.target.value); } @@ -98,7 +105,7 @@ class PropertyViewContainer extends React.Component id: option.getId(), name: option.getName() }))} - onChange={e => this.handleInputChange(e)} + onChange={e => this.handleEnumChange(e)} /> ); }