angular / angular/components

bug(Text field): cdkAutosizeMinRows and cdkAutosizeMaxRows not working

Aperta
#26,233 7 commenti 15 reazioni 0 assegnatari Vedi su GitHub
area: cdk/text-field 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

14.2.7

### Description

cdkAutosizeMinRows and cdkAutosizeMaxRows are not working properly.

### Reproduction

Steps to reproduce:
1. Go to https://material.angular.io/cdk/text-field/examples
2. In the "Auto-resizing textarea" example, type a few lines

### Expected Behavior

In the example, it should grow to 5 lines. I tested the example on stackblitz and changed the min/max values and the size doesn't respect those.

### Actual Behavior

In the example, after the 3rd one, the textarea stopped growing.
In stackblitz, there didn't seem to be any logic based on the value I was entering. There seems to be a hard stop at 6 lines, and it looks like it is 2 lines off (max of 5 shows 3 lines, max of6 shows 4 lines, ...).

### Environment

- Angular: 15.0.0
- CDK/Material: 15.0.2
- Browser(s): Chrome Version 108.0.5359.98 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con gli esempi CDK text-field all’indirizzo https://material.angular.io/cdk/text-field/examples e riproduci il problema nell’esempio “Auto-resizing textarea” usando le versioni segnalate Angular 15.0.0 e CDK/Material 15.0.2. Confronta cdkAutosizeMinRows e cdkAutosizeMaxRows con la crescita effettiva dell’area di testo; il lavoro è completato quando l’esempio rispetta entrambi i valori.

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.