Re: [pointerevents] Clarify what the target of the click event should be after capturing pointer events (#356)

Posting here because I'm working on a web app which uses setPointerCapture and has a fairly complex use case, namely a graph editor (https://noisecraft.app/101). I keep running into inconsistencies into the way pointer capture works across Chrome/Safari/FF and it's driving me insane.

I really think Chrome has the best behavior with respect to pointer capture and `click`. The way I think of it, while an element has pointer capture, it "owns" all of the mouse events. It allows the capturing element to implement its own behavior until the capture is released. I really think this is the most intuitive behavior and what most people will want.

In my specific use case, my graph editor has a knob node, and you can "grab" the knob with your pointer to change its value. This involves clicking on the knob and then moving the mouse outside of the knob's area, and releasing the knob when you've reached the value you want. In Chrome this works well, in Firefox and FF, a `click` event gets triggered elsewhere. This is forcing me to either avoid relying on onclick, or resort to awful hacks like having an invisible fullscreen div to prevent any other DOM elements from receiving the click...

So please, please, please, make it so that `click` is sent to the event that started the pointer capture. This is the only sensible answer.



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


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

Received on Friday, 11 March 2022 04:38:50 UTC