Handle on change in field

This commit is contained in:
lukasmartinelli
2016-09-12 20:29:53 +02:00
parent 7c7c8b7111
commit ae0a12dcd8
5 changed files with 25 additions and 8 deletions

View File

@@ -10,12 +10,16 @@ class EnumField extends React.Component {
doc: React.PropTypes.string,
}
onChange(e) {
return this.props.onChange(e.target.value)
}
render() {
const options = this.props.allowedValues.map(val => {
return {children: val, value: val}
})
return <Select
onChange={this.props.onChange}
onChange={this.onChange.bind(this)}
name={this.props.name}
options={options}
label={this.props.name}