diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index a66665d..0917834 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -430,7 +430,16 @@ return; } - if (!hovered || $(document.activeElement).is(":input,[contenteditable]")) { + if (!hovered) { + return; + } + + var activeElement = document.activeElement; + // go deeper if element is a webcomponent + while (activeElement.shadowRoot) { + activeElement = activeElement.shadowRoot.activeElement; + } + if ($(activeElement).is(":input,[contenteditable]")) { return; }