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

Method _handleFocus

src/cdk/listbox/listbox.ts:219–227  ·  view source on GitHub ↗

Handle focus events on the option.

()

Source from the content-addressed store, hash-verified

217
218 /** Handle focus events on the option. */
219 protected _handleFocus() {
220 // Options can wind up getting focused in active descendant mode if the user clicks on them.
221 // In this case, we push focus back to the parent listbox to prevent an extra tab stop when
222 // the user performs a shift+tab.
223 if (this.listbox.useActiveDescendant) {
224 this.listbox._setActiveOption(this);
225 this.listbox.focus();
226 }
227 }
228
229 /** Get the tabindex for this option. */
230 protected _getTabIndex() {

Callers 1

ngAfterContentInitFunction · 0.45

Calls 2

focusMethod · 0.65
_setActiveOptionMethod · 0.45

Tested by

no test coverage detected