Skip to content

Commit b9be4f9

Browse files
authored
Use null instead of document as intersection observer root (livekit#703)
* use body instead of document as intersection observer root * Create thick-seas-push.md * use null to keep behaviour
1 parent 97248d9 commit b9be4f9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.changeset/thick-seas-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"livekit-client": patch
3+
---
4+
5+
Use body instead of document as intersection observer root

src/room/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,12 @@ export const getResizeObserver = () => {
228228

229229
let intersectionObserver: IntersectionObserver | null = null;
230230
export const getIntersectionObserver = () => {
231-
if (!intersectionObserver)
231+
if (!intersectionObserver) {
232232
intersectionObserver = new IntersectionObserver(ioDispatchCallback, {
233-
root: document,
233+
root: null,
234234
rootMargin: '0px',
235235
});
236+
}
236237
return intersectionObserver;
237238
};
238239

0 commit comments

Comments
 (0)