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

Method _backArrowPressed

src/cdk/menu/menu-item.ts:254–266  ·  view source on GitHub ↗

* Handles the user pressing the back arrow key. * @param event The keyboard event.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

252 * @param event The keyboard event.
253 */
254 private _backArrowPressed(event: KeyboardEvent) {
255 const parentMenu = this._parentMenu!;
256 if (this._menuStack.hasInlineMenu() || this._menuStack.length() > 1) {
257 event.preventDefault();
258 this._menuStack.close(parentMenu, {
259 focusNextOnEmpty:
260 this._menuStack.inlineMenuOrientation() === 'horizontal'
261 ? FocusNext.previousItem
262 : FocusNext.currentItem,
263 focusParentTrigger: true,
264 });
265 }
266 }
267
268 /**
269 * Handles the user pressing the forward arrow key.

Callers 1

_onKeydownMethod · 0.95

Calls 4

hasInlineMenuMethod · 0.80
inlineMenuOrientationMethod · 0.80
lengthMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected