mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Prevent mouse interaction with form elements in PresentationMode (issue 12232)
This commit is contained in:
parent
c059c13785
commit
f0811a4a3c
3 changed files with 29 additions and 22 deletions
|
@ -224,21 +224,24 @@ class PDFPresentationMode {
|
|||
evt.preventDefault();
|
||||
return;
|
||||
}
|
||||
if (evt.button === 0) {
|
||||
// Enable clicking of links in presentation mode. Note: only links
|
||||
// pointing to destinations in the current PDF document work.
|
||||
const isInternalLink =
|
||||
evt.target.href && evt.target.classList.contains("internalLink");
|
||||
if (!isInternalLink) {
|
||||
// Unless an internal link was clicked, advance one page.
|
||||
evt.preventDefault();
|
||||
if (evt.button !== 0) {
|
||||
return;
|
||||
}
|
||||
// Enable clicking of links in presentation mode. Note: only links
|
||||
// pointing to destinations in the current PDF document work.
|
||||
if (
|
||||
evt.target.href &&
|
||||
evt.target.parentNode?.hasAttribute("data-internal-link")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
// Unless an internal link was clicked, advance one page.
|
||||
evt.preventDefault();
|
||||
|
||||
if (evt.shiftKey) {
|
||||
this.pdfViewer.previousPage();
|
||||
} else {
|
||||
this.pdfViewer.nextPage();
|
||||
}
|
||||
}
|
||||
if (evt.shiftKey) {
|
||||
this.pdfViewer.previousPage();
|
||||
} else {
|
||||
this.pdfViewer.nextPage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue