From ac7bbcfa3f415f3bcc1789516e79a4e64637f5d3 Mon Sep 17 00:00:00 2001 From: Zach Guo <3478203+zachguo@users.noreply.github.com> Date: Wed, 26 Aug 2020 14:22:48 -0700 Subject: [PATCH 1/2] IE11 compatibility for document.contains --- src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index ce3faee..5e3168d 100644 --- a/src/util.ts +++ b/src/util.ts @@ -33,7 +33,7 @@ export function monitorResize(element: HTMLElement, callback: Function) { let prevHeight: number = null; function onResize([{ target }]: ResizeObserverEntry[]) { - if (!document.contains(target)) return; + if (!document.body.contains(target)) return; const { width, height } = target.getBoundingClientRect(); const fixedWidth = Math.floor(width); const fixedHeight = Math.floor(height); From c02f13fabe0673d69c7bf5eed66416d085430eef Mon Sep 17 00:00:00 2001 From: Kermit Date: Thu, 17 Sep 2020 19:42:20 +0800 Subject: [PATCH 2/2] fix: contains method compatibility for IE11 --- src/util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.ts b/src/util.ts index 5e3168d..a6f7c08 100644 --- a/src/util.ts +++ b/src/util.ts @@ -33,7 +33,7 @@ export function monitorResize(element: HTMLElement, callback: Function) { let prevHeight: number = null; function onResize([{ target }]: ResizeObserverEntry[]) { - if (!document.body.contains(target)) return; + if (!document.documentElement.contains(target)) return; const { width, height } = target.getBoundingClientRect(); const fixedWidth = Math.floor(width); const fixedHeight = Math.floor(height);