From 907f97d8832560971dee9aacdd8811a64b7122c7 Mon Sep 17 00:00:00 2001 From: Michael Dellanoce Date: Thu, 12 Jan 2023 12:54:17 -0500 Subject: [PATCH] apply text mask settings to inputs #1096 --- packages/rrweb-snapshot/src/snapshot.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rrweb-snapshot/src/snapshot.ts b/packages/rrweb-snapshot/src/snapshot.ts index a8401393c7..d7eed8ccdf 100644 --- a/packages/rrweb-snapshot/src/snapshot.ts +++ b/packages/rrweb-snapshot/src/snapshot.ts @@ -343,6 +343,12 @@ export function needMaskingText( el = node.parentElement; } try { + const el: HTMLElement | null = + node.nodeType === node.ELEMENT_NODE + ? (node as HTMLElement) + : node.parentElement; + if (el === null) return false; + if (maskTextSelector === '*') return true; if (typeof maskTextClass === 'string') { if (checkAncestors) { if (el.closest(`.${maskTextClass}`)) return true;