Skip to content

Commit 433f260

Browse files
committed
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 parent d121f40 commit 433f260

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DateTime.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,15 @@ var Datetime = React.createClass({
161161
updatedState = this.getStateFromProps( nextProps );
162162
}
163163

164+
// What is this for? Keeping for now, will remove later
164165
if ( updatedState.open === undefined ) {
165166
updatedState.open = this.state.open;
166167
}
167168

169+
if ( this.props.closeOnSelect === false ) {
170+
updatedState.open = true;
171+
}
172+
168173
if ( nextProps.viewMode !== this.props.viewMode ) {
169174
updatedState.currentView = nextProps.viewMode;
170175
}

0 commit comments

Comments
 (0)