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;