angular / angular/components

bug(mat-list): Bad symmetry on text when line-break in code

Aperta
#26,657 0 commenti 5 reazioni 0 assegnatari Vedi su GitHub
area: material/list P3
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

v14

### Description

The text in both matListItemTitle and matListItemLine creates a whitespace at the start and end of the text when the code is broken over multiple lines. This breaks the symmetry of the list items as seen in this example on the docs page
![image](https://user-images.githubusercontent.com/3032384/220096686-6c734818-a024-42af-8536-fee6da3ccad8.png)

### Reproduction

Stackblitz of the issue already showing in the docs page:
https://stackblitz.com/run?file=src%2Fapp%2Flist-variants-example.ts

Works:
`Text`

Creates extra spacing:
```

Text

```

### Expected Behavior

Expect the result not to have white spaces when rendered, or to ignore the white spaces. As it worked in v14.

### Actual Behavior

Gets an extra white space when the code has line break inside tag. Breaks symmetry

### Environment

- Angular: latest v15
- CDK/Material: latest v15
- Browser(s): All
- Operating System (e.g. Windows, macOS, Ubuntu): All

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione StackBlitz, in particolare src/app/list-variants-example.ts, e confronta il markup renderizzato di matListItemTitle e matListItemLine con contenuto span inline e multilinea. Segui l’implementazione pertinente delle liste di Angular Material a partire dalla riproduzione e verifica che il markup multilinea venga renderizzato senza spazi bianchi iniziali o finali e preservi la simmetria degli elementi della lista.

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
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.