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

Method _setNextFocusToSelectedOption

src/cdk/listbox/listbox.ts:914–921  ·  view source on GitHub ↗

Sets the first selected option as first in the keyboard focus order.

()

Source from the content-addressed store, hash-verified

912
913 /** Sets the first selected option as first in the keyboard focus order. */
914 private _setNextFocusToSelectedOption() {
915 // Null check the options since they only get defined after `ngAfterContentInit`.
916 const selected = this.options?.find(option => option.isSelected());
917
918 if (selected) {
919 this.listKeyManager.updateActiveItem(selected);
920 }
921 }
922
923 /** Update the internal value of the listbox based on the selection model. */
924 private _updateInternalValue() {

Callers 4

_handleFocusMethod · 0.95
_handleFocusOutMethod · 0.95
_initKeyManagerMethod · 0.95
_setSelectionMethod · 0.95

Calls 2

updateActiveItemMethod · 0.80
isSelectedMethod · 0.65

Tested by

no test coverage detected