MatAutocomplete panel does not close when the parent input changes focus programmatically.
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
When adding host listener for keyboard navigation to other elements, the auto complete panel does not close.
### Reproduction
StackBlitz link: https://stackblitz.com/edit/angular-14-material-fbxecy?file=src%2Fauto-complete%2Fauto-complete.component.html
Steps to reproduce:
1. Click in the "Number" input.
2. Press Ctrl+DownArrow.
3. Observe that focus moves to the text area input without closing the panel.
### Expected Behavior
After the focus of the parent input moves to another element (either by click() or blur()), the panel should be closed.
### Actual Behavior
After moving focus from the parent input by using element.focus() the auto complete panel keeps visible until a click action takes place.
### Environment
- Angular: 14
- CDK/Material:
- Browser(s): Edge
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Ouvrez la reproduction StackBlitz liée et inspectez src/auto-complete/auto-complete.component.html. Suivez ensuite la gestion du focus de MatAutocomplete pour les changements de focus programmatiques. Reproduisez le flux Ctrl+DownArrow et vérifiez que le déplacement du focus avec element.focus(), click() ou blur() ferme le panneau comme prévu.
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é
- Plutôt claire
- Accessibilité débutants
- 45/100