angular / angular/components

bug(cdkTextareaAutosize): Textarea padding breaks auto-height work

Đang mở
#26,997 8 bình luận 14 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ả

### Description

It is not possible to set vertical padding for Textarea
- it doesn't count
- as you enter text, the height of the field increases without adding a newline

### Reproduction

Steps to reproduce:
1. Use
```
cdkTextareaAutosize
cdkAutosizeMinRows="1"
cdkAutosizeMaxRows="10"
```
3. Add padding to style ".textarea {padding: 10px;}"

### Expected Behavior

- added padding
- the height only changes when the text is increased by one line

### Actual Behavior

- field height increases for each letter
- vertical padding is not taken into account

stackblitz - [https://stackblitz.com/edit/angular-zqu9zw](https://stackblitz.com/edit/angular-zqu9zw?file=src%2Fmain-component.html)

### Environment

- Angular: 15.2.8
- CDK/Material: 15.2.8
- Browser(s): Chrome Version 112.0.5615.138
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10

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 bản tái hiện cdkTextareaAutosize trong StackBlitz được liên kết và so sánh hành vi của nó với các thiết lập padding và số hàng đã nêu. Công việc hoàn tất khi padding theo chiều dọc được tính vào chiều cao đã tính toán và textarea chỉ tăng kích thước khi văn bản thêm một dòng.

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
Đặc tả rõ ràng
Mức phù hợp với người mới
50/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.