Fix: isBlocked throws on invalid HTML element (#1032)
This commit is contained in:
@@ -235,7 +235,7 @@ export function isBlocked(
|
|||||||
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
|
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
|
||||||
}
|
}
|
||||||
if (blockSelector) {
|
if (blockSelector) {
|
||||||
if ((node as HTMLElement).matches(blockSelector)) return true;
|
if (el.matches(blockSelector)) return true;
|
||||||
if (checkAncestors && el.closest(blockSelector) !== null) return true;
|
if (checkAncestors && el.closest(blockSelector) !== null) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user