w3c / touch-events

https://w3c.github.io/touch-events/
26 stars 24 forks source link

8. Interaction with Mouse Events and click #110

Closed joeedh closed 2 years ago

joeedh commented 2 years ago

This is ridiculous:

"The user agent may dispatch both touch events and (for compatibility with web content not designed for touch) mouse events"

May? Even worse:

"If touchstart, touchmove, or touchend are canceled, the user agent should not dispatch any mouse event that would be a consequential result of the prevented touch event."

Seriously? This is like the apotheosis of undefined behavior. So the browser may emulate mouse events. Or it may not. In order to be safe touchstart should cancel. Which totally breaks the observer idiom of event handling.

This is completely broken.

patrickhlauke commented 2 years ago

thanks for the feedback joe. you can go and blame a certain fruit company for just inventing the events and then trying to block any standardisation effort at the time. this simply documents the behaviour (weird secret heuristics and all) that they originally implemented and browsers had to attempt to copy for compat reasons.

may i suggest switching to using Pointer Events instead, which are the much more sensible and robust way of handling mouse/touch/stylus? https://w3c.github.io/pointerevents/