Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug(form-field): notch width is out of sync with custom label content during layout changes

Aperta
#33,207 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
angular, typescript
Ambito
frontend

Direzione di ricerca

Inizia con la riproduzione StackBlitz fornita in src/main.ts e analizza il comportamento del contorno di mat-form-field durante il ridimensionamento del contenitore. Confronta il contenuto del mat-label flottante con la tacca durante le modifiche del layout. È completato quando la tacca segue in modo sincrono la larghezza della label, senza scorrimenti, spostamenti o sovrapposizioni visibili.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: material/form-field P4
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:

  1. Create a mat-form-field with appearance="outline" and floatLabel="always".
  2. Apply display: flex to the mat-label (or a container immediately inside it).
  3. Place a text string and an icon (e.g., mat-icon) inside that flex container.
  4. 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).
  5. 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
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 1h
PR unite (30g)
84

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/components

Tutte le issue di angular/components

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.