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

Method setDefaultState

src/aria/private/menu/menu.ts:214–221  ·  view source on GitHub ↗

Sets the default state for the menu.

()

Source from the content-addressed store, hash-verified

212
213 /** Sets the default state for the menu. */
214 setDefaultState() {
215 if (!this.inputs.parent()) {
216 const firstFocusable = this.listBehavior.navigationBehavior.peekFirst();
217 if (firstFocusable) {
218 this.listBehavior.goto(firstFocusable, {focusElement: false});
219 }
220 }
221 }
222
223 /** Sets the default active state of the menu before receiving interaction for the first time. */
224 setDefaultStateEffect(): void {

Callers 4

setDefaultStateEffectMethod · 0.95
setDefaultStateEffectMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45

Calls 3

parentMethod · 0.80
peekFirstMethod · 0.45
gotoMethod · 0.45

Tested by

no test coverage detected