1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Merge pull request #12405 from nickyc975/fixed-active-element-in-shadow-dom

Fixed keydown event handling problem with shadow DOM.
This commit is contained in:
Tim van der Meij 2020-09-26 23:02:13 +02:00 committed by GitHub
commit 6728c8fa61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 1 deletions

View file

@ -19,6 +19,7 @@ import {
AutoPrintRegExp,
DEFAULT_SCALE_VALUE,
EventBus,
getActiveOrFocusedElement,
getPDFFileNameFromURL,
isValidRotation,
isValidScrollMode,
@ -2829,7 +2830,7 @@ function webViewerKeyDown(evt) {
// Some shortcuts should not get handled if a control/input element
// is selected.
const curElement = document.activeElement || document.querySelector(":focus");
const curElement = getActiveOrFocusedElement();
const curElementTagName = curElement && curElement.tagName.toUpperCase();
if (
curElementTagName === "INPUT" ||