Closed mustaqahmed closed 2 years ago
I have started documenting contextmenu
in the algorithmic rewrite of uievents: https://w3c.github.io/uievents/event-algo.html
(also note the other hooks for PointerEvents in that document)
@garykac It seems to me that your algorithmic rewrite could be supplemented by a contextmenu
event entry in the existing list of Mouse Event Types, which would provide non-algorithmic details like the event's attributes etc. I am working on a PR now to create that entry, please let me know your thoughts.
@Herst The proposed PR makes "contextmenu" event a PointerEvent instance. So suppressing the context-menu from a touch interaction should be trivial:
if (event.pointerType === "touch") event.preventDefault();
Apparently no spec defines
contextmenu
event! The event is marked as aMouseEvent
in a non-normative section in the HTML spec, that's it.As of today, it seems UI Event spec would be the place for it because the event is a MouseEvent in all major browsers. Note, however, that we are planning to change it to a PointerEvent, see https://github.com/w3c/pointerevents/issues/100.