Skip to content

Commit

Permalink
Enable text action context menu in text annotation text box
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Dec 4, 2024
1 parent b9373b3 commit 4c9e517
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pdf/pdf-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}
}
Expand Down

0 comments on commit 4c9e517

Please sign in to comment.