From c5d1b038806b1fc96c79fc00029382f9052cbe6a Mon Sep 17 00:00:00 2001 From: Ben White Date: Wed, 24 Apr 2024 13:20:40 +0200 Subject: [PATCH] Fix --- src/heatmaps.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/heatmaps.ts b/src/heatmaps.ts index 27c484ae1..ecb645a2f 100644 --- a/src/heatmaps.ts +++ b/src/heatmaps.ts @@ -33,7 +33,8 @@ function elementOrParentPositionMatches(el: Element, matches: string[], breakOnE const TOOLBAR_ID = '__POSTHOG_TOOLBAR__' function elementInToolbar(el: Element): boolean { - return el.id === TOOLBAR_ID || !!el.closest('#__POSTHOG_TOOLBAR__') + // NOTE: .closest is not supported in IE11 hence the operator check + return el.id === TOOLBAR_ID || !!el.closest?.('#__POSTHOG_TOOLBAR__') } export class Heatmaps {