angular / angular/components

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

Abierto
#27,722 3 comentarios 3 reacciones 0 asignados Ver en GitHub
area: material/form-field P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con los ejemplos de StackBlitz enlazados, comparando src/app/form-field-appearance-example.html de Angular Material 14.2.7 con src/example/form-field-appearance-example.html y src/index.html de 16.2.1. Confirma el comportamiento del espacio inicial en mat-hint y mat-error y, a continuación, verifica que el comportamiento esperado se restaure sin romper la alineación multilínea.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.