Skip to content

Commit

Permalink
context menu (right click): run action on left mouse UP event, not ju…
Browse files Browse the repository at this point in the history
…st click (down+up), to align with how context menus typically work basically everywhere
  • Loading branch information
phil294 committed May 18, 2023
1 parent b2174d0 commit 7d2e568
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web/src/directives/context-menu.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ set_context_menu = (###* @type HTMLElement ### el, ###* @type {(ev: MouseEvent)=
label_el.textContent = entry.label
entry_el.appendChild(icon_el)
entry_el.appendChild(label_el)
entry_el.onclick = entry.action
entry_el.onmouseup = (e) =>
entry.action() if e.button == 0
wrapper_el?.appendChild(entry_el)
document.body.appendChild(wrapper_el)

Expand Down

0 comments on commit 7d2e568

Please sign in to comment.