When I select a date and then a time, the Datepicker should close
When I select a date and then a time, the Datepicker stays open
<DatePicker
selected={props.startDate}
onChange={props.changeStartDate}
showTimeSelect
timeIntervals={30}
dateFormat="MM/DD/YY, hh:mm a"
todayButton="Today"
minDate={moment()}
readOnly
/>
I have the latest version. I'm not sure why this is happening.
Same here!
I'm seeing this on dekstop as well.
I experience this problem using mobile Chrome browser and also desktop Chrome with device mode on. Couldn't reproduce this problem at Firefox
I find that adding 'preventOpenOnFocus' to props will solve this problem
<DatePicker
selected={props.startDate}
onChange={props.changeStartDate}
showTimeSelect
timeIntervals={30}
dateFormat="MM/DD/YY, hh:mm a"
todayButton="Today"
minDate={moment()}
readOnly
preventOpenOnFocus
/>
I have resolved this issue and already created PR #1400
Use of preventOpenOnFocus is not used that much if my requirement is related to the focus event like in the form after every field user generally used the tab to move next.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
I find that adding 'preventOpenOnFocus' to props will solve this problem
<DatePicker selected={props.startDate} onChange={props.changeStartDate} showTimeSelect timeIntervals={30} dateFormat="MM/DD/YY, hh:mm a" todayButton="Today" minDate={moment()} readOnly preventOpenOnFocus />