Fix Select onChange prop
Summary: Was passing in a Proxy instance before instead of a string. Now it passes the correct string that callers would expect. Reviewed By: sjkirby Differential Revision: D10181911 fbshipit-source-id: 8dfa677479a81de0f7b5be23f827ce7b52169931
This commit is contained in:
committed by
Facebook Github Bot
parent
a54b542d17
commit
490f5e7f5a
@@ -15,11 +15,15 @@ export default class Select extends Component<{
|
|||||||
onChange: (key: string) => void,
|
onChange: (key: string) => void,
|
||||||
selected?: ?string,
|
selected?: ?string,
|
||||||
}> {
|
}> {
|
||||||
|
onChange = (event: Object) => {
|
||||||
|
this.props.onChange(event.target.value);
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {className, options, selected} = this.props;
|
const {className, options, selected} = this.props;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<select onChange={this.props.onChange} className={className}>
|
<select onChange={this.onChange} className={className}>
|
||||||
{Object.keys(options).map(key => (
|
{Object.keys(options).map(key => (
|
||||||
<option selected={key === selected}>{options[key]}</option>
|
<option selected={key === selected}>{options[key]}</option>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Reference in New Issue
Block a user