bug(form-field): notch width is out of sync with custom label content during layout changes
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
- 52/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend
Direção de pesquisa
Comece com a reprodução fornecida do StackBlitz em src/main.ts e inspecione o comportamento do contorno de mat-form-field ao redimensionar o contêiner. Compare o conteúdo do mat-label flutuante com o entalhe durante as mudanças de layout. Está concluído quando o entalhe acompanha a largura do label de forma síncrona, sem deslizamento, deslocamento ou sobreposição visível.
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
The MDC-based mat-form-field (outline appearance) fails to synchronously update the notch (gap) width when the content inside mat-label changes its layout or when the container is resized. This is especially evident when using custom components with Flexbox inside the label (e.g., for adding help icons or tooltips).
Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-starter-gnupffhv?file=src%2Fmain.ts
Steps to reproduce:
- Create a
mat-form-fieldwithappearance="outline"andfloatLabel="always". - Apply
display: flexto themat-label(or a container immediately inside it). - Place a text string and an icon (e.g.,
mat-icon) inside that flex container. - Dynamically change the width of the form field's container (e.g., by resizing the browser window or using a slider in the provided reproduction).
- Observe the behavior of the label content and the notch gap.
Expected Behavior
The notch gap should resize synchronously with the label content to prevent any "sliding" or "drifting" effect. The gap in the outline should always match the actual width of the floating label in real-time during container resizing or layout shifts, ensuring that the border never overlaps the label's text or icons.
Actual Behavior
There is a significant visual lag in the label's positioning and scaling. While the browser's layout engine expands the container instantly, the label's text content moves and resizes with a delay.
In this implementation, we intentionally prioritize the visibility of the tooltip/icon over the label text.. This ensures that the help trigger is always accessible to the user, even on small screens
Lag Animation: https://github.com/user-attachments/assets/a3e9ff59-8586-449b-95d1-d5d0b3e0f727
Environment
- Angular: 21.2.10
- CDK/Material: 21.2.8
- Browser(s): Chrome 147.0.7727.138
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
- 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
-
module-request
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 1 dia
-
ports get and web print 'Port N already in use, trying next...' for every busy port they skipAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
appandflow/stim#1604 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
lingdojo/kana-dojo#31060 · 1 comentário · 5 reações ·
Mantenedores costumam responder em até 1 dia
-
SSH workspace restore rewrites relative symlinks into the deleted sync-back staging directoryAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
paperclipai/paperclip#14173 ·
Mantenedores costumam responder em até 1 dia
-
needs-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia