Skip to content

Commit

Permalink
Fix clicking on PDF view gray zone
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtcode committed Jul 1, 2024
1 parent ff63d18 commit 32abd4f
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/pdf/pdf-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,6 @@ class PDFView {
return !!this._focusedObject;
}

setSelection(selection) {
this.selection = selection;
}

getPageByIndex(pageIndex) {
return this._pages.find(x => x.pageIndex === pageIndex);
}
Expand Down Expand Up @@ -1529,7 +1525,10 @@ class PDFView {

if (this._options.platform !== 'web' && event.button === 2) {
let br = this._iframe.getBoundingClientRect();
let selectableAnnotation = (this.getSelectableAnnotations(position) || [])[0];
let selectableAnnotation;
if (position) {
selectableAnnotation = (this.getSelectableAnnotations(position) || [])[0];
}
let selectedAnnotations = this.getSelectedAnnotations();
if (!selectableAnnotation) {
if (this._selectedAnnotationIDs.length !== 0) {
Expand All @@ -1548,9 +1547,9 @@ class PDFView {
return;
}


if (!position) {
this.setSelection();
this._setSelectionRanges();
this._onSelectAnnotations([], event);
this._render();
return;
}
Expand Down

0 comments on commit 32abd4f

Please sign in to comment.