mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
fix isTreeItem method when called with non-element nodes (#1026)
This commit is contained in:
@@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user