-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Improve touch support #569
Comments
No one? Please note I am using the inline datepicker. Edit: my assumption was wrong. The 'touchend' event causes the date to be selected, not the 'mousedown' event. Removing the 'touchend' event fixes the swiping issue on mobile when the datepicker is displayed inline, but prevents the date from being selected when binding the datepicker to an input field. |
Srsly how has no one responded to this!?!?!?!? |
In case anyone else is trying to figure this out, this worked for me on Pikaday 1.5.1 with a non-bound datepicker: var picker = new Pikaday({
field: document.querySelector("#datepicker"),
bound: false,
container: document.querySelector("#datepicker-container"),
onOpen: function () {
if (!!window.removeEventListener) {
this.el.removeEventListener("touchend", this._onMouseDown, true);
} else {
this.el.detachEvent('on' + "touchend", this._onMouseDown);
}
}
}); |
Is there any other workaround for having tap events select the dates, but still allow swiping the screen to scroll without selecting the dates? |
Linked PR #397 |
Still experiencing on mobile the jumping of 2 months. Any updates re: this? |
Hi,
Swiping the datepicker (because I want to scroll past it) causes the day (read: date cell) I happened to touch to swipe, to be selected. This is because swiping triggers a mousedown event.
I'm not quite sure why the mousedown event was chosen over the mouseup event, but right now this is causing usability issues for me on mobile.
Could the event be easily replaced? Or perhaps it is possible to detect a touch event, in which case the date selection can be prevented?
Thanks in advance!
The text was updated successfully, but these errors were encountered: