From a573d2cd9dad76e28e49363409d257ead7bcc4d2 Mon Sep 17 00:00:00 2001 From: Mathieu Lorber Date: Wed, 1 Oct 2014 11:49:16 +0200 Subject: [PATCH] ShadowDom form elements are considered for preventing scrolling by keyevent --- src/perfect-scrollbar.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 7a72051..105e211 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -431,7 +431,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; }