From 46b2d38ec4ad35b5efd1329a1bf1089060674ac7 Mon Sep 17 00:00:00 2001 From: eoghan Date: Wed, 26 Aug 2020 12:54:10 +0000 Subject: [PATCH] Need to look at the top document to be able to capture page scrolls also --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 2fa1783b31..97ff6a6df5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -20,7 +20,7 @@ import { INode } from 'rrweb-snapshot'; export function on( type: string, fn: EventListenerOrEventListenerObject, - target: Document | Window = document, + target: Document | Window = getTopWindow().document, ): listenerHandler { const options = { capture: true, passive: true }; target.addEventListener(type, fn, options);