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

contextMenu on right click not working #31

Open
akkivarma opened this issue Feb 15, 2018 · 4 comments
Open

contextMenu on right click not working #31

akkivarma opened this issue Feb 15, 2018 · 4 comments

Comments

@akkivarma
Copy link

Even after setting the option mouseClick to 'right', right click isn't working for me

@mota57
Copy link

mota57 commented Sep 3, 2018

same here this is not working


 var menu = [{
                    name: 'create',
                    title: 'create button',
                    fun: function () {
                        alert('i am add button')
                    }
                }, {
                    name: 'update',
                    title: 'update button',
                    fun: function () {
                        alert('i am update button')
                    }
                }, {
                    name: 'delete',
                    title: 'delete button',
                    fun: function (ev) {
                        console.log(ev);
                        alert('i am delete button')
                    }
                }];
             
            //Calling context menu
             $(window.document).contextMenu(menu, window.document.body, {mouseClick:'left'});

@bcleuing
Copy link

I solved the problem by including the option "triggerOn".

var menu = [{
  name: 'delete',
  title: 'delete button',
  fun: function (data, event) {
    alert('delete button');
  },
}]
$('#trigger').contextMenu(menu, {
  mouseClick: 'right',
  triggerOn: 'click' // without this the menu will not show with right-click events
});

@s-yadav
Copy link
Owner

s-yadav commented May 14, 2019

Also, you might want to set triggerOn: 'contextmenu' otherwise browser's default contextMenu will open on right click.

@mota57
Copy link

mota57 commented Jun 24, 2019

thanks guys! in my humble opinion the default behavior should be right click.

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

No branches or pull requests

4 participants