perf(cdkTextareaAutosize): Skip height measurements when textarea value is empty
- 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
Calls to _measureScrollHeight, which trigger css layout, are not needed when there's nothing in the text field. In this case, simply set the height to 1 row (height of one line).
See internal CL 421826236 for more context.
### Reproduction
Steps to reproduce:
1. Bootstrap a textarea with cdkTextareaAutosize that has value of '' (empty)
### Expected Behavior
_measureScrollHeight() called only when there's a non-empty value.
### Actual Behavior
_measureScrollHeight() is called regardless of value.
### Environment
- Angular: 13
- CDK/Material: 13
- Browser(s): All
- Operating System (e.g. Windows, macOS, Ubuntu): All
Guía de contribución
Línea de trabajo
Comienza en la implementación de cdkTextareaAutosize y sigue el punto de entrada _measureScrollHeight usando un textarea cuyo valor esté vacío. Confirma que los valores vacíos usan una altura de una fila sin medición, mientras que los valores no vacíos mantienen el comportamiento de medición; añade o actualiza la prueba pertinente si se identifica la ubicación de las pruebas de la implementación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- frontend, performance
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 35/100