amsul / pickadate.js

The mobile-friendly, responsive, and lightweight jQuery date & time input picker.
http://amsul.ca/pickadate.js
MIT License
7.7k stars 1.02k forks source link

Set pointer capture on pointerdown on picker input #1167

Closed NavidZ closed 5 years ago

NavidZ commented 5 years ago

Chrome 73 starts sending click even to the common ancestor of down and up events even when one was inside the input element and the other one was outside. This caused this library to fail in the following scenario: User presses down on the picker input which causes the date picker and overlay to be shown. When user releases the button the overlay gets the up event and the common ancestor of these elements will get the click. Since there is a click handler on the document to close the popup, the calendar popup immediately closes.

Using pointercapture API to capture the rest of the pointerevents stream to the picker input it ensures the click event target is the picker input and that ensures the click handler doesn't dismiss the popup.

DanielRuf commented 5 years ago

Hi @NavidZ,

Please check the failing tests.

DanielRuf commented 5 years ago

Also this will not work in older browsers.

We will not merge this solution for the regression bug for v3.

As others already wrote, revert the change and provide a proper migration path.

https://bugs.chromium.org/p/chromium/issues/detail?id=941910

You already confirmed that this is a regression bug in Chromium and we will not add other workarounds or solutions like this for one specific browser bug. I still not understand why the Chromium developers do not simply revert or fix this and push the responsibility to us library maintainers.

Pickadate 3.6.3 works without any problems so we do not need this vendor specific solution.