I've heard contextmenu is deprecated: https://html.spec.whatwg.org/multipage/obsolete.html#attr-contextmenu
Then, Is there are ways to replace it?
As the feature was not that popular, it is no longer supported.:
The support for HTML5 context menus, introduced with Firefox 8, will be removed soon. Other browser vendors were not interested in the feature, and therefore it has already been removed from the HTML spec, leaving Firefox as the only browser implementing the and elements as well as the contextmenu global attribute.
If desired, you can instead create your own context menu as seen in some rich web applications like Google Drive. The WAI-ARIA standard provides a way to create accessible menus which is highly recommended.
You can create your own menus using ARIA.
Instead of <menu> & <menu-item>
you use normal lists (<ul> & <li>
), decorate them and use JS for functionality.
You find more details and presets here and here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With