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

Method _getItem

src/aria/private/tabs/tabs.ts:303–311  ·  view source on GitHub ↗

Returns the tab item associated with the given event.

(e: Event)

Source from the content-addressed store, hash-verified

301
302 /** Returns the tab item associated with the given event. */
303 private _getItem(e: Event) {
304 const target = _getEventTarget(e);
305 if (!(target instanceof Element)) {
306 return;
307 }
308
309 const element = target.closest('[role="tab"]');
310 return element ? this.inputs.items().find(i => i.element() === element) : undefined;
311 }
312}

Callers 2

TabListPatternClass · 0.95
onFocusInMethod · 0.95

Calls 2

_getEventTargetFunction · 0.90
elementMethod · 0.45

Tested by

no test coverage detected