Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paging months/year causes the date select dropdown to close immediately when using FastClick #720

Closed
SimonKaluza opened this issue Jan 2, 2015 · 8 comments

Comments

@SimonKaluza
Copy link

Selecting the next month or year using the datepicker on a web application using the FastClick js library (https://github.com/ftlabs/fastclick) for mobile devices causes the calendar selector to hide itself immediately.

This seems to be an issue with touchstart versus click listeners, as discussed here ftlabs/fastclick#48 and here twbs/bootstrap#6488.

@Eonasdan
Copy link
Owner

do you still have this issue with v4?

@timothyarmes
Copy link

This still fails on V4, it's currently unusable when using FastClick.

Adding the 'needsclick' class to all tappable elements should fix it.

@Eonasdan
Copy link
Owner

I can't reproduce this in the current version.

Please provide a fiddle or a demo page exhibiting the issue

@brad
Copy link

brad commented May 28, 2015

@Eonasdan
https://jsfiddle.net/bradpitcher/gLsqtzjs/2/

Open on mobile or enable "device mode" in chrome developer tools to witness the issue

@phpMagpie
Copy link

I'm also having this problem when combining fastclick and https://github.com/smalot/bootstrap-datetimepicker.

Adding the 'needsclick' class to the form input element helped with that library. I tried adding that class to @brad's jsfiddle and it did not help.

@coxw
Copy link

coxw commented Aug 3, 2015

Same - adding needsclick class to all of the th/td elements is what is required for this to work with fastclick. This is specifically testing it on iPad. It would be helpful to be able to add classes to clickable elements to get around this, or you can make a nasty hack like this:

if ('ontouchstart' in document.documentElement) {
  $('#datesAvailable').on("dp.update,dp.show", function(e) {
    $('#datesAvailable').find('th,td').addClass('needsclick');
  });
}

@Gronis
Copy link

Gronis commented May 3, 2016

Im trying to use datetimepicker together with fastclick without success. I've tried your hack coxw but somehow when the layout changes (for example when switching between months) without calling update/show/change function, which in turns closes the popup the next click. Why is this issue closed when the issue seems to be unresolved?

@dweber019
Copy link

This can be fix with touchstart. I'll do a PR

@ghost ghost locked and limited conversation to collaborators Jun 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants