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

Commit 0af61f2

Browse files
committed
docs: comment on why using window when listening to scroll events
1 parent 177184d commit 0af61f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utilites.ts

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export function fromScrollParent(elRef: MaybeElementRef): Observable<Element> {
5656
const scrollParents = (
5757
vertical === horizontal ? [vertical] : [vertical, horizontal]
5858
).map((parent) =>
59+
// If the scrolling parent is the doc root, use window instead.
60+
// As using doc root might not work
5961
parent === document.documentElement ? window : parent
6062
);
6163

0 commit comments

Comments
 (0)