Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We don't have a definition for "contextmenu" event #279

Closed
mustaqahmed opened this issue Nov 4, 2020 · 4 comments · Fixed by #316
Closed

We don't have a definition for "contextmenu" event #279

mustaqahmed opened this issue Nov 4, 2020 · 4 comments · Fixed by #316

Comments

@mustaqahmed
Copy link
Member

Apparently no spec defines contextmenu event! The event is marked as a MouseEvent 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 w3c/pointerevents#100.

@garykac
Copy link
Member

garykac commented Nov 4, 2020

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)

@mustaqahmed
Copy link
Member Author

@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.

@mustaqahmed
Copy link
Member Author

@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();

andreubotella added a commit to andreubotella/pointerevents that referenced this issue Jan 19, 2022
The reference to the `contextmenu` event in 4.2.12 links to the HTML
spec, even though any non-editorial mentions of that event –but not the
definition in the event list– were removed (apparently by mistake) in
whatwg/html#2742. That event was subsequently added to the UI Events
spec in w3c/uievents#279, and now the definition in the HTML spec's
event list has been removed in whatwg/html#7506. This change updates
the reference to link to the UI Events spec.
patrickhlauke pushed a commit to w3c/pointerevents that referenced this issue Jan 19, 2022
The reference to the `contextmenu` event in 4.2.12 links to the HTML
spec, even though any non-editorial mentions of that event –but not the
definition in the event list– were removed (apparently by mistake) in
whatwg/html#2742. That event was subsequently added to the UI Events
spec in w3c/uievents#279, and now the definition in the HTML spec's
event list has been removed in whatwg/html#7506. This change updates
the reference to link to the UI Events spec.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants