angular / angular/components

bug(MAT-ERROR): mat error content with block element gives extra space of 16px

Aperta
#27,787 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
area: material/form-field P4
Lingua principale
TypeScript
Stelle
25k
Fork
6.8k
Merge medio
1g 8h
PR unite (30g)
91

Descrizione

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

If the error message is rendered within a block element (we have some error message which are from a database and have a div element), an extra space is added. If this done by design, maybe it should also be mentioned in the docs?
Look at this example: https://stackblitz.com/edit/g5mias?file=src%2Fexample%2Fform-field-error-example.html

### Reproduction

StackBlitz link: https://stackblitz.com/edit/g5mias?file=src%2Fexample%2Fform-field-error-example.html
Steps to reproduce:
1. focus and blur the field

### Expected Behavior

Render the error messages directly underneath the input field

### Actual Behavior

The error messages are shown 16px below the input field

### Environment

- Angular: 16 latest
- CDK/Material: 16 latest

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con l’esempio StackBlitz collegato in src/example/form-field-error-example.html e riproduci il problema mettendo a fuoco il campo e poi rimuovendo il focus. Confronta il rendering dell’errore di Angular 16 Material con il posizionamento previsto; il lavoro è completato quando il contenuto dell’errore dell’elemento block appare direttamente sotto il campo di input senza lo spazio aggiuntivo di 16px.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
angular, typescript
Ambito
frontend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.