Skip to content

Add a "preShow" callback, to conditionally show context menu or not. #669

Open

Description

@Mike-Benoit

In our case we want the jquery context menu to appear if the user right-clicks anywhere on the screen, but have the browsers native context menu to appear if they right-click on a textarea, input box, or some other special element of our choosing. One of the main reasons is that if you turn off right-click to get to browser native copy/cut/paste/translate/etc... actions, users seem to complain pretty loudly.

I realize there are ways to get this behavior right now, but from my understanding they are pretty difficult in our case, specifically when the selector is dynamic and where their may be multiple different context menus registered.

As an easy work around, if you could simply register a "preShow" callback (I think jQuery-ui tabs does something like this), that passes in the event, and the current contextmenu object, we could then make any decisions we want and either cause the context menu to appear, not appear, or show the browser native context menu based on the return value of that callback.

Activity

  1. bbrala commented on Oct 22, 2018

    @bbrala
    Member

    Yeah that is a great idea.

  2. bshafiei-ir commented on May 26, 2019

    @bshafiei-ir

    I need it too.
    @bbrala

  3. bbrala commented on May 26, 2019

    @bbrala
    Member

    I will make some time this week to get going on issues, have been a bit swamped lately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions