* Resets the active option. When the list is disabled, remove all options from to the tab order. * Otherwise, focus the first selected option.
()
| 480 | * Otherwise, focus the first selected option. |
| 481 | */ |
| 482 | private _resetActiveOption() { |
| 483 | if (this.disabled) { |
| 484 | const activeItem = this._items.find(item => item.selected) || this._items.first; |
| 485 | const index = activeItem ? this._items.toArray().indexOf(activeItem) : -1; |
| 486 | this._setActiveOption(index); |
| 487 | return; |
| 488 | } |
| 489 | |
| 490 | const activeItem = |
| 491 | this._items.find(item => item.selected && !item.disabled) || this._items.first; |
| 492 | this._setActiveOption(activeItem ? this._items.toArray().indexOf(activeItem) : -1); |
| 493 | } |
| 494 | |
| 495 | /** Returns whether the focus is currently within the list. */ |
| 496 | private _containsFocus() { |
no test coverage detected