bug(form-field): notch width is out of sync with custom label content during layout changes
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- angular, typescript
- Bereich
- frontend
Rechercherichtung
Beginne mit der bereitgestellten StackBlitz-Reproduktion in src/main.ts und untersuche das Umrissverhalten von mat-form-field beim Ändern der Containergröße. Vergleiche den Inhalt des schwebenden mat-label mit der Aussparung während der Layoutänderungen. Abgeschlossen ist die Aufgabe, wenn die Aussparung der Breite des Labels synchron folgt, ohne sichtbares Gleiten, Abdriften oder Überlappen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 13 Std.
- Gemergte PRs (30 T.)
- 100
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus angular/components
-
area: material/datepicker P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/components#33763 · 2 Kommentare · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: material/table P4
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
angular/components#33709 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: material/table docs gemini-triaged P4
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
angular/components#33455 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: material/core gemini-triaged P3
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
angular/components#33059 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: material/dialog P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
angular/components#30536 · 3 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in angular/components
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
lichess-org/api#678 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
PostHog/posthog.com#20628 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug status:Needs Triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
jupyterlab/jupyterlab#19964 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
agentscope-ai/QwenPaw#8064 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: notebooks-jupyter bug theme: new notebook frontend
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
posit-dev/positron#16347 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag