angular / angular/components

bug(mat-error,mat-hint): mat-error and mat-hint display leading spaces

Ouverte
#27,722 3 commentaires 3 réactions 0 personnes assignées Voir sur GitHub
area: material/form-field P3
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

14.2.7

### Description

In versions pre mdc migration mat-hint and mat-error do NOT display leading spaces.
In versions post mdc migration mat-hint and mat-error do display leading spaces.

This behavior causes multi-line hints and errors to not align properly.

Of course this just a small thing an can be fixed by formatting the html differently but it is technically an undocumented breaking change. So i need to know if this is intended behavior and i have to fix it in my code or if it will be fixed in angular material.

Apparently there was already an issue for that #26430 but it was closed for not being reproducable but my StackBlitz Links show that it is still the case.

### Reproduction

Working StackBlitz link (14.2.7): https://stackblitz.com/edit/xxdwty?file=src%2Fapp%2Fform-field-appearance-example.html
Error StackBlitz link (16.2.1): https://stackblitz.com/edit/qopght?file=src%2Fexample%2Fform-field-appearance-example.html,src%2Findex.html

### Expected Behavior

Leading spaces are not displayed.

### Actual Behavior

Leading spaces are displayed.

### Environment

- Angular: 16
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par les exemples StackBlitz liés, en comparant src/app/form-field-appearance-example.html d’Angular Material 14.2.7 avec src/example/form-field-appearance-example.html et src/index.html de 16.2.1. Confirmez le comportement de l’espace initial dans mat-hint et mat-error, puis vérifiez que le comportement attendu est rétabli sans perturber l’alignement multiligne.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.