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

Method _handleFocus

src/cdk/listbox/listbox.ts:704–714  ·  view source on GitHub ↗

Called when the listbox receives focus.

()

Source from the content-addressed store, hash-verified

702
703 /** Called when the listbox receives focus. */
704 protected _handleFocus() {
705 if (!this.useActiveDescendant) {
706 if (this.selectionModel.selected.length > 0) {
707 this._setNextFocusToSelectedOption();
708 } else {
709 this.listKeyManager.setNextItemActive();
710 }
711
712 this._focusActiveOption();
713 }
714 }
715
716 /** Called when the user presses keydown on the listbox. */
717 protected _handleKeydown(event: KeyboardEvent) {

Callers

nothing calls this directly

Calls 3

_focusActiveOptionMethod · 0.95
setNextItemActiveMethod · 0.80

Tested by

no test coverage detected