Fix: isBlocked throws on invalid HTML element (#1032)

This commit is contained in:
dbseel
2023-01-10 04:23:29 -05:00
committed by GitHub
parent d08913d0dc
commit 66abe17832

View File

@@ -235,7 +235,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;