angular / angular/components

bug(Text field): cdkAutosizeMinRows and cdkAutosizeMaxRows not working

オープン
#26,233 コメント 7 件 リアクション 15 件 担当者 0 名 GitHub で見る
area: cdk/text-field P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

https://material.angular.io/cdk/text-field/examples の CDK text-field の例から始め、報告されている Angular 15.0.0 および CDK/Material 15.0.2 のバージョンを使用して「Auto-resizing textarea」の例で問題を再現します。設定された cdkAutosizeMinRows と cdkAutosizeMaxRows を textarea の実際の拡大と比較します。例が両方の値を尊重すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。