question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Datepicker doesn't exit on mobile when selecting date and time.

See original GitHub issue

Expected behavior

When I select a date and then a time, the Datepicker should close

Actual behavior

When I select a date and then a time, the Datepicker stays open

Steps to reproduce

<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.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

3reactions
wengkhingcommented, Mar 6, 2018

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 />

1reaction
chandawarlokeshcommented, Jun 13, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery Datepicker close datepicker after selected date
I use bootstrap datepicker. When I click to datepicker it opens and I select any date. My question: If I choose date from...
Read more >
DatePicker empty value - Power Platform Community - Microsoft
Solved: Have been playing some more with the DatePicker in an EditForm, but can't seem to work out how to ensure a blank...
Read more >
Datepicker documentation for JQuery | Mobiscroll
Name Type Default value anchor HTMLElement undefined animation String, Boolean undefined buttons Array
Read more >
3 steps to implementing a better date picker in Power Apps
The first step is to create a component in your app. Then within your app create a calendar screen using the screen template...
Read more >
Date Picker Dialog Example | APG | WAI - W3C
Choosing a date from the calendar closes the dialog and populates the date input field. When the dialog is opened, if the input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found