don't trigger menu items on right click, #3764

This commit is contained in:
zadam
2023-03-27 22:49:41 +02:00
parent 79a6baca6f
commit 3192531d4c
2 changed files with 6 additions and 5 deletions

View File

@@ -99,11 +99,16 @@ class ContextMenu {
const $item = $("<li>")
.addClass("dropdown-item")
.append($link)
.on('contextmenu', e => false)
// important to use mousedown instead of click since the former does not change focus
// (especially important for focused text for spell check)
.on('mousedown', e => {
e.stopPropagation();
if (e.which !== 1) { // only left click triggers menu items
return false;
}
this.hide();
if (item.handler) {