Skip to content

Clicking on a <select> triggers the press event after the set time, despite having released the button #1303

@php4fan

Description

@php4fan

To reproduce:

  1. visit https://jsfiddle.net/tL9kqune/ (even on desktop)
  2. Watch the console
  3. 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:

Hammer press event

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions