I'm working on a web platform where users can select/highlight text and perform selection-specific actions on the highlighted text. The current implementation shows a custom context menu on selection (immediately - no right click required).

However, given that right-clicking is commonly associated with performing an action, could it be more appropriate to replace the default (OS-specific) context menu?

I understand that disabling standard shortcuts (e.g. copy/paste) will invariably lead to user frustration and is bad practice. I also found an answer stating that it depends on whether a feature is removed in the user's best interests - which I find rather vague. Thus, let me specify the question:

  • Is it bad practice to change default UI behaviour, in casu to replace the browser context menu?
    • If so, what could be an acceptable alternative? Showing both menus simultaneously seems a bit crass.
    • If not, should the replacement menu mimic default behaviour (e.g. contain a "copy" button)?
  • Is it important whether the replacement menu looks substantially different from the (expected) default menu?
  • What about replacing the -webkit-touch-callout menu on iOS/Android? Do the same conclusions apply?

No, disabling the context menu does not constitute bad practice. This is a common behavior.

Real world references: Try right-clicking in Gmail or Google Docs. Obviously, these are highly successful services that have been thoroughly user tested.

In general, I would venture to say that if what you are building resembles an application (a utility that solves a work related task for a targeted set of users) then a context menu can be highly productive. Obviously, this will make some things harder for a subset of users, but as you say, you can support some use cases by mimicking default behaviour.

Having said that, if the default options are assumed to be used often, and the new, contextual options are less frequently used, then you can look at e.g. the Atlassian Confluence wiki, which presents a small action icon above selected text.

Menu on right click in Google Sheets:

enter image description here

Action icon on selection (not right click) in Atlassian Confluence:

enter image description here


Disabling the context menu would depend on the main goal or objective. If you are building a testing app that would disallow cheating like copy and pasting then its valid and sensible. Now if there is no true business value it will be nightmare to be consistent across all platforms and would require high maintenance and that's bad practice so to speak.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.