angular / angular/components

but(FormFiled): Floating label hide/show not responsive when set to outline appearance.

Abierto
#29,939 7 comentarios 0 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

When you have a mat form field and the mat-label is conditional. If the view starts with the label and gets remove with @if in template it is perfectly fine. Will disappear and reappear. If the view starts with-out the mat label rendered, the label will get rendered but the component, 'MatFormFieldNotchedOutline" still has the class, 'mdc-notched-outline--no-label', so the display is set to none.

Looks as though if the mat-label is not there on view init it is not responsive.

The behavior works fine with fill appearance.

### Reproduction

StackBlitz link:
Steps to reproduce:
1.
2.

### Expected Behavior

When mat-label gets rendered in even after init, i.e. Using a structural directive or decorator such *ngIf or @if. The label should show no matter the appearance.

### Actual Behavior

When you have the appearance set to outline and the view is initially rendered without the label it is not responsive and will not show up.

### Environment

- Angular: 18.2.10
- CDK/Material: 18.2.10
- Browser(s): Edge, Chrom
- 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 el comportamiento de MatFormFieldNotchedOutline para la apariencia outline y reproduce un mat-label renderizado condicionalmente con @if después de la inicialización. Se considera terminado cuando el outline ya no conserva el estado sin label y el label aparece cuando se añade, coincidiendo con el comportamiento fill existente.

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
Necesita aclaración
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.