bug(form-field): notch width is out of sync with custom label content during layout changes
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 52/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- angular, typescript
- Domaine
- frontend
Piste de recherche
Commencez par la reproduction StackBlitz fournie dans src/main.ts et examinez le comportement du contour de mat-form-field lors du redimensionnement du conteneur. Comparez le contenu du mat-label flottant avec l’encoche pendant les changements de mise en page. C’est terminé lorsque l’encoche suit la largeur du label de manière synchrone, sans glissement, décalage ni chevauchement visible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 7 h
- PR mergées (30 j)
- 92
Préparer son environnement
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de angular/components
-
area: material/datepicker P4
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/components#33763 · 2 commentaires · 3 réactions ·
Les mainteneurs répondent en général sous 1 jour
-
area: material/table P4
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
angular/components#33709 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
area: material/table docs gemini-triaged P4
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
angular/components#33455 ·
Les mainteneurs répondent en général sous 1 jour
-
area: material/core gemini-triaged P3
Difficulté 1/5 Moins d'une heure Accessibilité débutants 78/100
angular/components#33059 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
area: material/dialog P2
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
angular/components#30536 · 3 réactions ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de angular/components
Issues similaires
-
Resources: New palettes of MacaoOuverteresources
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
railmapgen/rmg-palette#2445 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
danielmiessler/LifeOS#2242 ·
Les mainteneurs répondent en général sous 5 jours
-
good first issue hacktoberfest help wanted translation
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
callstackincubator/appduct#129 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 88/100