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

"Next month" jumps two months in Android 4.4.2 #540

Closed
MikaelEdebro opened this issue Jun 13, 2016 · 2 comments
Closed

"Next month" jumps two months in Android 4.4.2 #540

MikaelEdebro opened this issue Jun 13, 2016 · 2 comments

Comments

@MikaelEdebro
Copy link

MikaelEdebro commented Jun 13, 2016

First off, thanks for a great plugin. However, we're having an issue that might have quite large implications for mobile users.

When pressing "Next month" icon on my Samsung Note 2 (Android 4.4.2 native browser), it jumps two months, thus making it impossible to select a date that is in the month between.

Could the issue be that it's triggering both for "touchdown" and "touchup" (not sure what the events are actually called in the mobile world)?
It seems to be working fine when you hold down for a second or more. But if you just tap, it will jump 2 months.

I tried adding a debounce method, like this, but unfortunately it didn't resolve the issue:

picker = new Pikaday({
    field: document.getElementById(scope.id),
    defaultDate: new Date(scope.model),
    setDefaultDate: true,
    minDate: new Date(scope.minDate),
    maxDate: new Date(scope.maxDate),
    firstDay: 1,
    format: 'YYYY-MM-DD',
    i18n: getLocalizedNames(),
    numberOfMonths: getMonthsToShow(),   // 1 month for mobile, 2 for other devices
    position: datepickerPosition,
    reposition: false
});

picker._onMouseDown = debounce(picker._onMouseDown, 300);

It's working fine in Chrome for the same device. Only the native browser is having issues.
Any thoughts on potential solutions?

@takebo
Copy link

takebo commented Jul 13, 2016

Having same issue on native browser, Samsung Galaxy Tab 2 10.1, Android 4.0.3.

@wojciechczerniak
Copy link
Collaborator

Duplicate of #569

@wojciechczerniak wojciechczerniak marked this as a duplicate of #569 Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants