Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix: isBlocked throws on invalid HTML element
  • Loading branch information
dbseel committed Oct 27, 2022
commit 4fefcf8b4ce9c78b07563d46f760d32007b3a959
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