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

Method setDefaultState

src/aria/private/toolbar/toolbar.ts:232–240  ·  view source on GitHub ↗

* Sets the toolbar to its default initial state. * * Sets the active index to the first focusable widget.

()

Source from the content-addressed store, hash-verified

230 * Sets the active index to the first focusable widget.
231 */
232 setDefaultState() {
233 const firstItem = this.navigationBehavior.peekFirst({
234 items: this.inputs.items(),
235 });
236
237 if (firstItem) {
238 this.inputs.activeItem.set(firstItem);
239 }
240 }
241
242 /** Sets the default active state of the toolbar before receiving interaction for the first time. */
243 setDefaultStateEffect(): void {

Callers 2

setDefaultStateEffectMethod · 0.95
getPatternsFunction · 0.45

Calls 2

setMethod · 0.80
peekFirstMethod · 0.45

Tested by 1

getPatternsFunction · 0.36