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

Method _setActiveOption

src/material/list/selection-list.ts:457–460  ·  view source on GitHub ↗

* Sets an option as active. * @param index Index of the active option. If set to -1, no option will be active.

(index: number)

Source from the content-addressed store, hash-verified

455 * @param index Index of the active option. If set to -1, no option will be active.
456 */
457 private _setActiveOption(index: number) {
458 this._items.forEach((item, itemIndex) => item._setTabindex(itemIndex === index ? 0 : -1));
459 this._keyManager.updateActiveItem(index);
460 }
461
462 /**
463 * Resets the active option. When the list is disabled, remove all options from to the tab order.

Callers 3

MatSelectionListClass · 0.95
_setupRovingTabindexMethod · 0.95
_resetActiveOptionMethod · 0.95

Calls 2

_setTabindexMethod · 0.80
updateActiveItemMethod · 0.80

Tested by

no test coverage detected