bug(MatFormField): Outline form field with prefix labels misalign when the document direction is changed.
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 56/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend, internationalization
Direção de pesquisa
Comece com a reprodução vinculada do StackBlitz e inspecione a implementação do Angular Material MatFormField envolvida nos rótulos de outline e nos prefixos. Alterne a direção do documento sem renderizar novamente e, em seguida, compare o comportamento após renderizar novamente; considera-se concluído quando o rótulo permanece corretamente alinhado ao alternar entre LTR e RTL.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 25k
- Forks
- 6.8k
- Merge médio
- 1d 7h
- PRs com merge (30d)
- 92
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/components
-
area: material/datepicker P4
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/components#33763 · 2 comentários · 3 reações ·
Mantenedores costumam responder em até 1 dia
-
area: material/table P4
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
angular/components#33709 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area: material/table docs gemini-triaged P4
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/components#33455 ·
Mantenedores costumam responder em até 1 dia
-
area: material/core gemini-triaged P3
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
angular/components#33059 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
area: material/dialog P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
angular/components#30536 · 3 reações ·
Mantenedores costumam responder em até 1 dia
Todas as issues de angular/components
Issues semelhantes
-
ADD openalgoAbertatemplate
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 90/100
vercel/ai#21528 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug Needs: Triage :mag:
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
microsoft/fluentui-contrib#671 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
sveltejs/acorn-typescript#150 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100