MatAutocomplete panel does not close when the parent input changes focus programmatically.
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
### 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
Guía de contribución
Línea de trabajo
Abra la reproducción vinculada de StackBlitz e inspeccione src/auto-complete/auto-complete.component.html. Después, siga el manejo del foco de MatAutocomplete para los cambios de foco programáticos. Reproduzca el flujo de Ctrl+DownArrow y verifique que mover el foco con element.focus(), click() o blur() cierre el panel como se espera.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100