MCPcopy Create free account
hub / github.com/angular/components / _getItem

Method _getItem

src/aria/private/tree/tree.ts:486–493  ·  view source on GitHub ↗

Retrieves the TreeItemPattern associated with a DOM event, if any.

(event: Event)

Source from the content-addressed store, hash-verified

484
485 /** Retrieves the TreeItemPattern associated with a DOM event, if any. */
486 protected _getItem(event: Event): TreeItemPattern<V> | undefined {
487 const target = _getEventTarget(event);
488 if (!(target instanceof Element)) {
489 return;
490 }
491 const element = target.closest('[role="treeitem"]');
492 return element ? this.inputs.items().find(i => i.element() === element) : undefined;
493 }
494}

Callers 2

onFocusInMethod · 0.95
gotoMethod · 0.95

Calls 2

_getEventTargetFunction · 0.90
elementMethod · 0.45

Tested by

no test coverage detected