react-datetime
react-datetime copied to clipboard
closeOnSelect not working
I'm working with react-datetime latest version(2.15.0). But closeOnSelect is not working. Date picker is closing after selecting either date or time.
<Datetime value={this.state.time} onChange={(event) => this.handleTimeChange(event)} dateFormat={"DD MMMM, YYYY"} className={'datepicker'} open={false} closeOnTab={true} viewDate={'Date'} timeFormat={"hh:mm A"} closeOnSelect={false} inputProps={{readOnly: true }} />
It's working when I removed onChange event.
The logic of closeOnSelect has been refactored for the version 3. This shouldn't happen anymore when it is released.
closeOnSelect doesn't work if one of parent is label
Guess cause can be in event bubbling to label parent and automatically focusing on the input element
closeOnSelect doesn't work if one of parent is label
Guess cause can be in event bubbling to label parent and automatically focusing on the input element
Had this same issue, until I changed my <label></label>
to <div></div>