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

Function _setKeyManager

src/cdk/menu/menu-base.ts:198–210  ·  view source on GitHub ↗

Setup the FocusKeyManager with the correct orientation for the menu.

()

Source from the content-addressed store, hash-verified

196
197 /** Setup the FocusKeyManager with the correct orientation for the menu. */
198 private _setKeyManager() {
199 this.keyManager = new FocusKeyManager(this.items)
200 .withWrap()
201 .withTypeAhead()
202 .withHomeAndEnd()
203 .skipPredicate(() => false);
204
205 if (this.orientation === 'horizontal') {
206 this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
207 } else {
208 this.keyManager.withVerticalOrientation();
209 }
210 }
211
212 /**
213 * Subscribe to the menu trigger's open events in order to track the trigger which opened the menu

Callers

nothing calls this directly

Calls 6

skipPredicateMethod · 0.80
withHomeAndEndMethod · 0.80
withTypeAheadMethod · 0.80
withWrapMethod · 0.80

Tested by

no test coverage detected