MCPcopy
hub / github.com/angular/components / getFocusedTreeItemValue

Function getFocusedTreeItemValue

src/aria/tree/tree.spec.ts:141–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139 }
140
141 function getFocusedTreeItemValue(): string | undefined {
142 let item: HTMLElement | undefined;
143 if (testComponent.focusMode() === 'roving') {
144 item = treeItemElements.find(el => el.getAttribute('tabindex') === '0');
145 } else {
146 const itemId = treeElement.getAttribute('aria-activedescendant');
147 if (itemId) {
148 item = treeItemElements.find(el => el.id === itemId);
149 }
150 }
151 return item?.getAttribute('data-value') ?? undefined;
152 }
153
154 async function expandAll() {
155 const fruitsEl = getTreeItemElementByValue('fruits')!;

Callers 2

tree.spec.tsFile · 0.85
isFocusedFunction · 0.85

Calls 1

getAttributeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…