Respect closeOnSelect property
This logic was lost in a previous commit, hopefully this new check will
be enough to cover all the cases as well as not ruining any others. I
did not manage to write a test for this as it required props I do not
know how to mock to be able to reproduce.
| | |
| | | updatedState = this.getStateFromProps( nextProps ); |
| | | } |
| | | |
| | | // What is this for? Keeping for now, will remove later |
| | | if ( updatedState.open === undefined ) { |
| | | updatedState.open = this.state.open; |
| | | } |
| | | |
| | | if ( this.props.closeOnSelect === false ) { |
| | | updatedState.open = true; |
| | | } |
| | | |
| | | if ( nextProps.viewMode !== this.props.viewMode ) { |
| | | updatedState.currentView = nextProps.viewMode; |
| | | } |