Web: Components: ComboBox: Fixed render conditions

This commit is contained in:
Ilya Oleshko 2020-01-23 09:29:23 +03:00
parent 367c89b34e
commit 69b1c39ac5

View File

@ -67,9 +67,9 @@ class ComboBox extends React.Component {
this.props.onSelect && this.props.onSelect(option); this.props.onSelect && this.props.onSelect(option);
}; };
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps) {
if (this.props.opened !== prevProps.opened && this.state.isOpen !== prevState.isOpen) { if (this.props.opened !== prevProps.opened) {
this.setIsOpen(this.state.isOpen); this.setIsOpen(this.props.opened);
} }
if (this.props.selectedOption !== prevProps.selectedOption) { if (this.props.selectedOption !== prevProps.selectedOption) {