Simon Egersand
2017-02-10 433f260a5c85fc7b51260693a1d38bef4cb0e524
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.
1 files modified
5 ■■■■■ changed files
DateTime.js 5 ●●●●● patch | view | raw | blame | history
DateTime.js
@@ -161,10 +161,15 @@
            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;
        }