angular / angular/components

bug(cdkTextareaAutosize): Autosize does not properly compute line heights when min-height or height is set via css

Đang mở
#28,101 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area: cdk/text-field P3
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

### 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 `height` or `min-height` is set on a `textarea`, cdkTextareaAutosize does not properly calculate the line height.

I have a pull request ready to fix this issue, and will submit it shortly.

### Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-mopjkj?file=src%2Fapp%2Fexample-component.css

### Expected Behavior

`height` and `min-height` should not affect the line height used to calculate the height based on min rows.

### Actual Behavior

`height` and `min-height` do affect the line height.

### Environment

- Angular: 16.2
- CDK/Material: 16.2
- Browser(s): Chrome (current)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với triển khai cdkTextareaAutosize và tái hiện hành vi bằng ví dụ StackBlitz được liên kết, đặc biệt là src/app/example-component.css của ví dụ đó. Xác minh cách CSS height và min-height ảnh hưởng đến chiều cao dòng được tính toán, sau đó xác nhận rằng việc định kích thước min-row không còn sử dụng các giá trị đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.