Skip to content

Commit

Permalink
fix: detect element nodes from nodeType
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 27, 2021
1 parent 9e52998 commit 1d3c519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Expand Up @@ -17,7 +17,7 @@ export const LIVE_REGION_QUERY = [
].join(', ');

export function isElement(node: Node | null): node is Element {
return node != null && 'closest' in node;
return node != null && node.nodeType === Node.ELEMENT_NODE;
}

export function getClosestElement(node: Node): Element | null {
Expand Down

0 comments on commit 1d3c519

Please sign in to comment.