-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Fix: Close datepicker on touchstart #1924
Fix: Close datepicker on touchstart #1924
Conversation
Can you add tests to avoid regressions like this in the future? Thanks! |
I've never done this for JS so I hope it's OK like this: I just copied the test that's used for the corresponding mouse event to a separate directory and let it trigger a touchstart event instead of mousedown. Let me know. |
LGTM! |
Thanks @clemens! |
That's quite likely. However: Mousedown wasn't triggered for me despite not scrolling – hence the PR. I'll double check and get back to you. |
That's great! Or if you have/find another workaround to support both cases would be nice! |
I've done a little investigation and it looks like there's no easy way to get both things working properly. The best idea I have (inspired by things I think I remember from other libs) would be as follows:
I'm afraid my JS skills probably don't suffice for a decent implementation of that solution. For the time being, I'd argue that being able to close the datepicker by touching outside of it is more important than the datepicker staying open when the user scrolls – but maybe that's just my point of view. I'd understand if you want to revert my PR. Cheers,
|
It seems that when the event system was reworked, the bug closed in #223 got reintroduced. This PR fixes this.