angular / angular/components

bug(form-field): remove hint wrapper when no hint provided

Abierto
#24,980 7 comentarios 18 reacciones 0 asignados Ver en GitHub
area: material/form-field P4
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?

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

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

_No response_

### Description

Even when no hint is provided, the hint-wrapper dom element still shows up.
This is because `mat-form-field-subscript-wrapper` has a margin as specified here:
```CSS
.mat-form-field-subscript-wrapper {
font-size: $subscript-font-size;
margin-top: $subscript-margin-top;
```

Screen Shot 2022-05-26 at 3 29 28 PM

### Reproduction

Steps to reproduce:
1. Add an outline material form field without any hint and inspect.
eg:
```HTML

Outline form field


```

### Expected Behavior

When no hint is being provided, the wrapper dom element shouldn't render.

### Actual Behavior

The wrapper renders and takes up space.

### Environment

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza reproduciendo el ejemplo proporcionado de outline mat-form-field e inspecciona su DOM generado, especialmente el elemento mat-form-field-subscript-wrapper y su espaciado. El issue estará resuelto cuando un campo de formulario sin hint no renderice ese wrapper y no quede espacio no deseado.

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
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
68/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.