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

Method getSubmenu

src/aria/menu/testing/menu-harness.ts:56–64  ·  view source on GitHub ↗

Resolves the nested submenu panel associated with this menu item, if any exists.

()

Source from the content-addressed store, hash-verified

54
55 /** Resolves the nested submenu panel associated with this menu item, if any exists. */
56 async getSubmenu(): Promise<MenuHarness | null> {
57 const controlsId = await (await this.host()).getAttribute('aria-controls');
58 if (controlsId) {
59 return this.documentRootLocatorFactory().locatorFor(
60 MenuHarness.with({selector: `#${controlsId}`}),
61 )();
62 }
63 return null;
64 }
65
66 /** Whether the menu item has focus. */
67 async isFocused(): Promise<boolean> {

Callers 1

Calls 4

locatorForMethod · 0.80
getAttributeMethod · 0.65
withMethod · 0.45

Tested by

no test coverage detected