* 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.
()
| 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 { |