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

Clarify (or override) dblclick event target #507

Open
masayuki-nakano opened this issue Jun 18, 2024 · 3 comments
Open

Clarify (or override) dblclick event target #507

masayuki-nakano opened this issue Jun 18, 2024 · 3 comments
Labels

Comments

@masayuki-nakano
Copy link

Pointer Events defines the event target of click, auxclick and contextmenu as same as userEvent which is fired by user's operation. So, this means that the event target may be different from the definition in UI Events because UI Events defines the event target of dblclick as:

the event target MUST be the same between mousedown, mouseup, and dblclick.

However, Pointer Events does not override dblclick event interface and does not mention it. Therefore, in the edge cases, click event target and dblclick event target may be different. I think that it is not developer-friendly. It must cause web-compat issues if browsers do not work exactly same as current odd and implicit definitions.

I think that Pointer Events should mention about dblclick event target at least since mousedown and mouseup may be prevented by a pointerdown event handler. I hope, the dblclick event target should be same as the preceding click and there should be WPTs.

@mustaqahmed
Copy link
Member

While I agree dblclick target could be clarified in a similar manner, I just found this comment that it is left as-is (as a legacy event) in favor of click.detail.

@mustaqahmed
Copy link
Member

I think the UI Events spec definition of dblclick target ("the event target MUST be the same between mousedown, mouseup and dblclick") is under-specified in multiple ways:

  • It does not consider the effect of Pointer Capture because I believe it predates Pointer Events spec.
  • It doesn't not specify the target if the DOM is modified in-between. For example, if the mousedown handler removes the target, will the dblclick be dispatched to the nearest common ancestor of mousedown and mouseup, or will the dispatch be skipped?

(Those are in addition to the main point you raised above: it doesn't mention if click and dblclick targets must be the same or not.)

@patrickhlauke
Copy link
Member

@mustaqahmed is there anything we can/should do for this for v3, or does it require more fundamental hooks/changes? marking as future for now, please feel free to change to v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants