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

Method setDefaultState

src/aria/private/menu/menu.ts:205–212  ·  view source on GitHub ↗

Sets the default state for the menu.

()

Source from the content-addressed store, hash-verified

203
204 /** Sets the default state for the menu. */
205 setDefaultState() {
206 if (!this.inputs.parent()) {
207 const firstFocusable = this.listBehavior.navigationBehavior.peekFirst();
208 if (firstFocusable) {
209 this.listBehavior.goto(firstFocusable, {focusElement: false});
210 }
211 }
212 }
213
214 /** Sets the default active state of the menu before receiving interaction for the first time. */
215 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