Skip to content

Commit

Permalink
Fix: isBlocked throws on invalid HTML element
Browse files Browse the repository at this point in the history
  • Loading branch information
dbseel committed Oct 27, 2022
1 parent 2286c11 commit 4fefcf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export function isBlocked(
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
}
if (blockSelector) {
if ((node as HTMLElement).matches(blockSelector)) return true;
if (el.matches(blockSelector)) return true;
if (checkAncestors && el.closest(blockSelector) !== null) return true;
}
return false;
Expand Down

0 comments on commit 4fefcf8

Please sign in to comment.