DEV Community

Discussion on: Custom Right Click Context Menu in JavaScript

Collapse
 
moopet profile image
Ben Sinclair

I'd try to discourage people from doing this, because you're changing the way people expect the browser to work, and annoying those who want to do things like save an image, or activate an accessibility feature from their regular context menu. It becomes even more tricky when you try to replicate the same thing on a touch device, where context menus like this will (if they even work) cover most of the user's viewport. It's not a good fit for small screens.

Collapse
 
georgewl profile image
George WL

There's no bad solutions, only bad usages and bad implementations.

This will definitely help

Collapse
 
shantanu_jana profile image
Shantanu Jana

You are right. This can cause many problems for the user. I created this article to inform beginners.

If someone needs a right click element in a project, they can create it this way.

Collapse
 
jamix-vcz profile image
JAMIX-VcZ

If you hold shift while right clicking, it will bring up the default menu

Collapse
 
moopet profile image
Ben Sinclair

@jamix-vcz that's only true in some browsers, in some contexts, and it's not something you can expect users to know.