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

Method _handleOverlayKeydown

src/material/select/select.ts:983–992  ·  view source on GitHub ↗

Handles keyboard events coming from the overlay.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

981
982 /** Handles keyboard events coming from the overlay. */
983 protected _handleOverlayKeydown(event: KeyboardEvent): void {
984 // TODO(crisbeto): prior to #30363 this was being handled inside the overlay directive, but we
985 // need control over the animation timing so we do it manually. We should remove the `keydown`
986 // listener from `.mat-mdc-select-panel` and handle all the events here. That may cause
987 // further test breakages so it's left for a follow-up.
988 if (event.keyCode === ESCAPE && !hasModifierKey(event)) {
989 event.preventDefault();
990 this.close();
991 }
992 }
993
994 _onFocus() {
995 if (!this.disabled) {

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
hasModifierKeyFunction · 0.90

Tested by

no test coverage detected