bug(MatFormField): Outline form field with prefix labels misalign when the document direction is changed.
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 56/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- angular, typescript
- Área
- frontend, internationalization
Línea de trabajo
Comienza con la reproducción vinculada de StackBlitz e inspecciona la implementación de Angular Material MatFormField relacionada con las etiquetas de contorno y los prefijos. Alterna la dirección del documento sin volver a renderizar y, después, compara el comportamiento tras volver a renderizar; se considera terminado cuando la etiqueta permanece correctamente alineada al cambiar entre LTR y RTL.
Escrito por el modelo de indexación a partir del texto del issue.
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 the direction property on the document is changed (LTR to RTL and viceversa), outline form fields with a prefix suffer from label misalignment. This presents a problem for apps that have forms and need to support a location switcher that has a RTL language like Arabic.
Reproduction
StackBlitz link: https://stackblitz.com/edit/3rswucyt?file=src%2Fexample%2Fform-field-appearance-example.html
Steps to reproduce:
- Observe button in default LTR mode.
- Click the "Toggle dir" button to change the direction in the wrapper to RTL
- Observe the label is now misaligned, trailing off to the right.
- Click the "Rerender" button to remove the form from the dom for one second
- Observe that when the component re-renders, the label alignment is correct.
- Click the "Toggle dir" button again to set the direction back to LTR
- Observe the label is misaligned again, only fixes when re-rendering the button.
Expected Behavior
When changing the direction, the label alignment should react and adjust.
Actual Behavior
The label is not aligning, it seems that it has the calculation obtained from before the direction changed. Since re-rendering the component fixes the problem, it appears that the logic is inside the component, but there is no way to notify the component a re-calculation is needed.
Environment
- Angular: 22.1.0
- CDK/Material: 22.1.0
- Browser(s): Google Chrome, Microsoft Edge, Safari
- Operating System (e.g. Windows, macOS, Ubuntu): MacOS
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 92
Preparar el entorno
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/components
-
area: material/datepicker P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/components#33763 · 2 comentarios · 3 reacciones ·
Los mantenedores suelen responder en 1 día
-
area: material/table P4
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
angular/components#33709 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area: material/table docs gemini-triaged P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/components#33455 ·
Los mantenedores suelen responder en 1 día
-
area: material/core gemini-triaged P3
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
angular/components#33059 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
area: material/dialog P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
angular/components#30536 · 3 reacciones ·
Los mantenedores suelen responder en 1 día
Todos los issues de angular/components
Issues similares
-
Add: Digi World (Romania) SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Fission-AI/OpenSpec#1986 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nestjs/docs.nestjs.com#3554 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
publicodes/publicodes#868 ·
-
namespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
EclipseFdn/open-vsx.org#13488 ·
Los mantenedores suelen responder en 2 días