To reproduce:
- visit https://jsfiddle.net/tL9kqune/ (even on desktop)
- Watch the console
- click on the select element to unfold it. Do NOT long-press, just click
Expected: should not trigger the Press event
Observed: triggers the Press event, and therefore this is logged to the console:
For comparison, try clicking on the "AAAA" text: that will not reproduce the issue. Only long press over the "AAAA" text will trigger the Press event, as expected.
This is the JavaScript source code of the above example:
$(function() {
$("#mycontainer, #other").each(function() {
const hammer = new Hammer(this);
hammer.get('press').set({ time: 750 });
hammer.on('press', function() {
console.log("Hammer press event");
});
});
});
JQueryMobile has the same issue, and it didn't use to, but JQueryMobile hasn't changed, so I'm guessing something must have changed in the behavior of both Chrome and Firefox, and it's probably affecting HammerJS too. Maybe it's a bug in both browsers, or more likely a bc-breaking change in the behavior specified by the standards.