Re: [pointerevents] Add context for popover light dismiss to click event (#542)

Thanks for filing this issue!  The general idea we are proposing here is useful beyond just the popover dismissal behavior: whether a click event came from a stationary vs a "drifting" `pointerdown/up` event pair seems useful from a web developer's perspective.

My original motivation for the discussion was that as a user, I rely on dragging the mouse to avoid accidental clicks, and currently web developers need to look into `pointerdown/up` events to detect this interaction.  If the click came from a possibly-shaky touch, some de-noising logic needs to be considered too.  Thanks for pointing out the accessibility guideline on [pointer cancellation](https://www.w3.org/WAI/WCAG21/Understanding/pointer-cancellation.html), the "Up-Event Abort or Undo" recommendation seems to be covering the same idea!

We can expose the stationary-vs-drifting information in a `click` event to help the situation above.  This is in addition to simplifying the spec for [popover light dismiss](https://html.spec.whatwg.org/multipage/popover.html#popover-light-dismiss).  Looks like there are some corner cases that the current spec misses; for example the popover probably shouldn't dismiss if I drag my finger outside the popover but a `touch-action:none` outside still produces a `pointerdown/up` pair and a click!

---

For folks unfamiliar with popover dismissal, here is a [demo](https://codepen.io/jarhar/pen/vEYwjJz?editors=1100) from @josepharhar.

-- 
GitHub Notification of comment by mustaqahmed
Please view or discuss this issue at https://github.com/w3c/pointerevents/issues/542#issuecomment-2814056529 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 17 April 2025 21:26:32 UTC