Skip to content

Commit 77912b5

Browse files
committed
properly unproxy IntersectionObserver
1 parent fad2311 commit 77912b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/client/shared/unproxy.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export default function (client: ScramjetClient, self: typeof window) {
5151
client.Proxy("IntersectionObserver", {
5252
construct(ctx) {
5353
unproxy(ctx, client);
54+
if (typeof ctx.args[1] === "object" && "root" in ctx.args[1])
55+
if (ctx.args[1].root === client.documentProxy)
56+
ctx.args[1].root = self.document;
5457
},
5558
});
5659

0 commit comments

Comments
 (0)