bug(CdkListbox): cdkOption requires additional event to rerender after list of options changed
- 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 any **option was selected** in the list and than user filtered them somehow and back to the initial list, **that selected option** will be rendered incorrectly.
https://github.com/angular/components/assets/13451032/4392054a-68e3-439e-a250-0084c943d37d
P.S. A bit similar problem was there: https://github.com/angular/components/issues/28557
### Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-xvgkha?file=src%2Findex.html,src%2Fmain.ts
Steps to reproduce:
1. Click **"Ron"** option (it becomes true)
2. Type in `input` letter **"J"**
3. Remove letter **"J"**
4. See that option **"Ron"** is false.
5. Type in input letter **"R"** or click outside `input`
6. See that option **"Ron"** is true.
### Expected Behavior
Option should be rendered immediately based on its internal state (`isSelected()/isActive()`).
### Actual Behavior
Option requires one more event to be rendered based on its internal state (`isSelected()/isActive()`).
### Environment
- Angular: 17
- CDK/Material: 17.3.3
- Browser(s): Chrome and Safari
- Operating System (e.g. Windows, macOS, Ubuntu):
Guía de contribución
Línea de trabajo
Comienza con la reproducción vinculada de StackBlitz, especialmente con src/index.html y src/main.ts, y sigue los pasos de filtrado para CdkListbox y cdkOption. Compara el estado renderizado de la opción seleccionada después de que la lista vuelva a su contenido inicial. Se considera terminado cuando la opción se renderiza inmediatamente a partir de su estado interno isSelected()/isActive(), sin requerir otro evento de entrada o de foco.
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