Web: Components: Fixed setState property name for ComboBox component
This commit is contained in:
parent
fbd1719898
commit
5eede5c600
@ -34,7 +34,7 @@ class ComboBox extends React.PureComponent {
|
||||
|
||||
this.ref = React.createRef();
|
||||
|
||||
const selectedItem = this.props.options.find(x => (x.key === this.props.selectedOption || x.id === this.props.selectedOption)) || this.props.options[0];
|
||||
const selectedItem = this.props.options.find(x => x.key === this.props.selectedOption) || this.props.options[0];
|
||||
console.log("combobox constructor label", selectedItem.label);
|
||||
|
||||
this.state = {
|
||||
@ -90,7 +90,7 @@ class ComboBox extends React.PureComponent {
|
||||
}
|
||||
|
||||
if(this.props.selectedOption !== prevProps.selectedOption) {
|
||||
const label = this.props.options.find(x => x.key === this.props.selectedOption || x.id === this.props.selectedOption).label;
|
||||
const label = this.props.options.find(x => x.key === this.props.selectedOption).label;
|
||||
console.log("combobox componentDidUpdate label", label, this.props.selectedOption);
|
||||
this.setState({boxLabel: label } );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user