From 4c9e5179bd4358b76b6316b15c06bd4e59a7f9c8 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Wed, 4 Dec 2024 21:14:25 +0000 Subject: [PATCH] Enable text action context menu in text annotation text box Fixes https://forums.zotero.org/discussion/120223/confusing-right-click-delete-for-text-annotation --- src/pdf/pdf-view.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pdf/pdf-view.js b/src/pdf/pdf-view.js index 78cdbd42..0b390ce5 100644 --- a/src/pdf/pdf-view.js +++ b/src/pdf/pdf-view.js @@ -1716,11 +1716,11 @@ class PDFView { this._onOpenViewContextMenu({ x: br.x + event.clientX, y: br.y + event.clientY, overlay }); } } - else if (!selectedAnnotations.includes(selectableAnnotation)) { + else if (!selectedAnnotations.includes(selectableAnnotation) && !this.textAnnotationFocused()) { this._onSelectAnnotations([selectableAnnotation.id], event); this._onOpenAnnotationContextMenu({ ids: [selectableAnnotation.id], x: br.x + event.clientX, y: br.y + event.clientY, view: true }); } - else { + else if (!this.textAnnotationFocused()) { this._onOpenAnnotationContextMenu({ ids: selectedAnnotations.map(x => x.id), x: br.x + event.clientX, y: br.y + event.clientY, view: true }); } this._render(); @@ -2551,7 +2551,7 @@ class PDFView { if (event.mozInputSource === 5 || event.mozInputSource === 6) { this._handlePointerDown(event); } - if (this._options.platform !== 'web') { + if (this._options.platform !== 'web' && !this.textAnnotationFocused()) { event.preventDefault(); } }