MCPcopy Index your code
hub / github.com/angular/components / _handleOverlayKeydown

Method _handleOverlayKeydown

src/material/select/select.ts:981–990  ·  view source on GitHub ↗

Handles keyboard events coming from the overlay.

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
hasModifierKeyFunction · 0.90

Tested by

no test coverage detected