Web: Components: Fixed setState property name for ComboBox component

This commit is contained in:
Ilya Oleshko 2019-08-06 10:26:26 +03:00
parent fbd1719898
commit 5eede5c600

View File

@ -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 } );
}