angular / angular/components

Datepicker - When open, pressing Esc key should just close datepicker and stop event propagation

Aperta
#12,344 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/datepicker P3
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

#### Bug, feature request, or proposal:
When a `Datepicker` is open, pressing `Esc` key closes it, which is fine. The issue arises when the parent component is also monitoring `Esc` key.

For example I have a form which contains the `Datepicker` component. I want the form to be closed when the user presses `Esc` key. But if the user has a `Datepicker` open, and presses `Esc` key, it closes the form, whereas it should only close the `Datepicker`.

#### What is the expected behavior?

`Datepicker` should stop propagation of the same event to the parent.

#### What are the steps to reproduce?
Visit https://stackblitz.com/edit/angular-b1wcka

Open datepicker and press `Esc` key to close `datepicker`, this will close the whole form instead of just closing the `datepicker`.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dalla gestione degli eventi da tastiera del Datepicker e riproduci il comportamento utilizzando l'esempio StackBlitz collegato. Verifica che premendo Esc il Datepicker si chiuda senza raggiungere il modulo padre, mentre il restante comportamento da tastiera rimanga invariato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.