Polymer / polymer

Our original Web Component library.
https://polymer-library.polymer-project.org/
BSD 3-Clause "New" or "Revised" License
22.04k stars 2.01k forks source link

Allow configuring cancelling synthetic click behavior #5533

Closed LarsDenBakker closed 5 years ago

LarsDenBakker commented 5 years ago

Fixes https://github.com/Polymer/polymer/issues/5289

The polymer gestures module cancels synthetic mouse clicks fired by old mobile browsers. This is no longer necessary (see https://developers.google.com/web/updates/2013/12/300ms-tap-delay-gone-away).

The cancellation detection incorrectly cancels programmatic clicks from javascript directly following a touch action. I added a failing test which demonstrates this behavior. If you run the test in chrome with device simulation enabled, the test would fail if the synthetic click events option is set to true.

This PR adds an option to allow configuring this behavior, leaving the default behavior intact to avoid breaking changes.

If this change is accepted, could we backport this to the Polymer 2 branch as well?

LarsDenBakker commented 5 years ago

@TimvdLippe Thanks! I also created the 2.x version: https://github.com/Polymer/polymer/pull/5536

LarsDenBakker commented 5 years ago

@sorvell @kevinpschaaf @azakus could you take a look at this?

LarsDenBakker commented 5 years ago

@azakus is it possible to release this as well as https://github.com/Polymer/polymer/pull/5536 ? :)