Skip to content

Commit

Permalink
fix isTreeItem method when called with non-element nodes (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
tao-cumplido committed Nov 24, 2022
1 parent 3dd19a7 commit 602a863
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/tree-item/tree-item.ts
Expand Up @@ -14,8 +14,8 @@ import '../spinner/spinner';
import styles from './tree-item.styles';
import type { CSSResultGroup, PropertyValueMap } from 'lit';

export function isTreeItem(element: Element) {
return element && element?.getAttribute('role') === 'treeitem';
export function isTreeItem(node: Node) {
return node instanceof Element && node.getAttribute('role') === 'treeitem';
}

/**
Expand Down

0 comments on commit 602a863

Please sign in to comment.