From ff9a8974e72d653b28c3fa56f749f900fa8b6cb1 Mon Sep 17 00:00:00 2001 From: csorfab Date: Tue, 26 Sep 2023 22:58:57 +0200 Subject: [PATCH] mobile fix --- src/handleScroll.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/handleScroll.ts b/src/handleScroll.ts index 21581f9..c2bf468 100644 --- a/src/handleScroll.ts +++ b/src/handleScroll.ts @@ -90,6 +90,9 @@ export const handleScroll = ( let availableScrollTop = 0; do { + if (target instanceof ShadowRoot) { + target = target.host as HTMLElement; + } const [position, scroll, capacity] = getScrollVariables(axis, target); const elementScroll = scroll - capacity - directionFactor * position;