Skip to content
This repository was archived by the owner on Nov 5, 2023. It is now read-only.

Commit 4843c44

Browse files
committed
fix: listen for scroll events on windows when the scroll parent is the document
1 parent 5d5d748 commit 4843c44

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utilites.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ export function fromScrollParent(elRef: MaybeElementRef): Observable<Element> {
5353
if (el) {
5454
const { vertical, horizontal } = getScrollParents(el);
5555

56-
const scrollParents =
57-
vertical === horizontal ? [vertical] : [vertical, horizontal];
56+
const scrollParents = (
57+
vertical === horizontal ? [vertical] : [vertical, horizontal]
58+
).map((parent) =>
59+
parent === document.documentElement ? window : parent
60+
);
5861

5962
const pushEl = () => scrollSubject.next(el);
6063

0 commit comments

Comments
 (0)