Datepicker - When open, pressing Esc key should just close datepicker and stop event propagation
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
#### 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`.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par la gestion des événements clavier du Datepicker et reproduisez le comportement à l’aide de l’exemple StackBlitz fourni. Vérifiez que l’appui sur Esc ferme le Datepicker sans atteindre le formulaire parent, tandis que le reste du comportement du clavier reste inchangé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 45/100