kopia lustrzana https://github.com/shoelace-style/shoelace
fix isTreeItem method when called with non-element nodes (#1026)
rodzic
3dd19a7f62
commit
602a863d89
|
@ -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';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Ładowanie…
Reference in New Issue