← Back to release summary

Dispatching click events to captured pointer

Category
User input
Type
New or changed feature
Status
In development (Chrome In development)
Intent stage
None

Summary

If a pointer is captured while the `pointerup` event is being dispatched, the `click` event will be dispatched to the captured target instead of the nearest common ancestor of `pointerdown` and `pointerup` events as per the UI Event spec. For uncaptured pointers, the `click` target remains unchanged.

Motivation

PEWG agreed to this new behavior after a multi-year deliberation [1] and updated the PointerEvents spec in 2023 [2]. The primary motivation for this decision is to make click targets more developer-friendly when pointer-capture. Note that the original "nearest common ancestor" targeting was defined in the UI Event spec many years before the pointer-capture concept was avalable. [1] https://github.com/w3c/pointerevents/issues/356 [2] https://github.com/w3c/pointerevents/pull/474

Standards & signals

Samples: https://codepen.io/mustaqahmed/full/YzawKWW

Explainers: https://w3c.github.io/pointerevents/#event-dispatch

View on chromestatus.com