Skip to content

Commit

Permalink
https://github.com/rrweb-io/rrweb/pull/840//files
Browse files Browse the repository at this point in the history
  • Loading branch information
John Pham committed Feb 22, 2022
1 parent 1759fb6 commit 12f81bd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,11 @@ export function isBlocked(node: Node | null, blockClass: blockClass): boolean {
if (node.nodeType === node.ELEMENT_NODE) {
let needBlock = false;
if (typeof blockClass === 'string') {
needBlock = (node as HTMLElement).classList.contains(blockClass);
if ((node as HTMLElement).closest !== undefined) {
return (node as HTMLElement).closest('.' + blockClass) !== null;
} else {
needBlock = (node as HTMLElement).classList.contains(blockClass);
}
} else {
(node as HTMLElement).classList.forEach((className) => {
if (blockClass.test(className)) {
Expand Down

0 comments on commit 12f81bd

Please sign in to comment.