Skip to content

Commit

Permalink
Only show native contextmenu with right click
Browse files Browse the repository at this point in the history
  • Loading branch information
victrme committed Dec 12, 2024
1 parent c7082cf commit 698bdb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scripts/features/links/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default async function openEditDialog(event: Event) {
const linkgroup = path.find((el) => el?.className?.includes('link-group'))
const linktitle = path.find((el) => el?.className?.includes('link-title'))

const ctrlRightClick = !!(event as PointerEvent).ctrlKey && event.type === 'contextmenu'
const pointer = event as PointerEvent
const ctrlRightClick = pointer.button === 2 && !!pointer.ctrlKey && event.type === 'contextmenu'
const pressingE = event.type === 'keyup' && (event as KeyboardEvent).code !== 'KeyE'

if (ctrlRightClick || pressingE) {
Expand Down

0 comments on commit 698bdb0

Please sign in to comment.