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.

Mobile Date Picker Doesn't Open on first Click

See original GitHub issue

I’m experiencing an issue with various settings on the latest iOS with the portal and without the portal. In which a prompt on the device appears either via a Done or an X as shown here:

glass_and_iphone_6_ ios_10_2__14c89

The user has to click done in order for the prompt to pop up. This is only an issue on iOS devices and not on android phones.

      <SingleDatePicker
        {...this.props}
        id="date_input"
        date={date}
        numberOfMonths={months}
        placeholder="00/00/00"
        focused={focused}
        onDateChange={this.onDateChange}
        onFocusChange={this.onFocusChange}
      />
      <SingleDatePicker
        {...this.props}
        id="date_input"
        date={date}
        withFullScreenPortal={true}
        withPortal={true}
        numberOfMonths={months}
        placeholder="00/00/00"
        focused={focused}
        onDateChange={this.onDateChange}
        onFocusChange={this.onFocusChange}
      />

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
NickTiutcommented, Feb 22, 2017

Any news on this? Anything I can do to help? An ugly workaround I’m using for this is to blur the input on focus: onFocusChange={(focused) => { $('.DateInput__input').blur(); self.setState({ focusedInput: focused }); }} It flashes the done bar on the bottom for a sec, and then the datepicker appears.

1reaction
StefanoPastorecommented, Feb 13, 2017

I found this approach:

let placeholder = document.createElement('div');
let isSupportedTouch = 'ontouchend' in placeholder;
// cross-browser check
if (!isSupportedTouch) {
  placeholder.setAttribute('ontouchend', 'return;');
  isSupportedTouch = typeof placeholder.ontouchend === 'function';
}
const event = isSupportedTouch ? 'touchstart' : 'click';
placeholder = null;

What do you think?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datepicker does not show at first click - Stack Overflow
You are initializing Date picker on your text box click. You have to initialize on document ready method if you want to Open...
Read more >
Mobile Date Picker Doesn't Open on first Click #246 - GitHub
I'm experiencing an issue with various settings on the latest iOS with the portal and without the portal. In which a prompt on...
Read more >
Have to click twice to initiate datepicker. Alert solves it. Why?
I have trouble with datepicker and I dont understand it. ... Only thing that does not work on the first click is datepicker()...
Read more >
Angular Material Datepicker: Complete Guide
Complete guided tour to the Angular Material Datepicker component, from the most commonly used features to the most advanced ones.
Read more >
JqueryUI - Datepicker - Tutorialspoint
Datepickers in jQueryUI allow users to enter dates easily and visually. You can customize the date format and language, restrict the selectable date...
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