MCPcopy Index your code
hub / github.com/angular/components / setDefaultState

Method setDefaultState

src/aria/private/toolbar/toolbar.ts:214–222  ·  view source on GitHub ↗

* Sets the toolbar to its default initial state. * * Sets the active index to the selected widget if one exists and is focusable. * Otherwise, sets the active index to the first focusable widget.

()

Source from the content-addressed store, hash-verified

212 * Otherwise, sets the active index to the first focusable widget.
213 */
214 setDefaultState() {
215 const firstItem = this.listBehavior.navigationBehavior.peekFirst({
216 items: this.inputs.items(),
217 });
218
219 if (firstItem) {
220 this.inputs.activeItem.set(firstItem);
221 }
222 }
223
224 /** Sets the default active state of the toolbar before receiving interaction for the first time. */
225 setDefaultStateEffect(): void {

Callers 2

setDefaultStateEffectMethod · 0.95
getPatternsFunction · 0.45

Calls 2

setMethod · 0.80
peekFirstMethod · 0.45

Tested by 1

getPatternsFunction · 0.36