angular / angular/components

bug(mat-error,mat-hint): mat-error and mat-hint display leading spaces

Đang mở
#27,722 3 bình luận 3 reaction 0 người được giao Xem trên GitHub
area: material/form-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?

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

In versions pre mdc migration mat-hint and mat-error do NOT display leading spaces.
In versions post mdc migration mat-hint and mat-error do display leading spaces.

This behavior causes multi-line hints and errors to not align properly.

Of course this just a small thing an can be fixed by formatting the html differently but it is technically an undocumented breaking change. So i need to know if this is intended behavior and i have to fix it in my code or if it will be fixed in angular material.

Apparently there was already an issue for that #26430 but it was closed for not being reproducable but my StackBlitz Links show that it is still the case.

### Reproduction

Working StackBlitz link (14.2.7): https://stackblitz.com/edit/xxdwty?file=src%2Fapp%2Fform-field-appearance-example.html
Error StackBlitz link (16.2.1): https://stackblitz.com/edit/qopght?file=src%2Fexample%2Fform-field-appearance-example.html,src%2Findex.html

### Expected Behavior

Leading spaces are not displayed.

### Actual Behavior

Leading spaces are displayed.

### Environment

- Angular: 16
- CDK/Material: 16.2.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

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 các ví dụ StackBlitz được liên kết, so sánh src/app/form-field-appearance-example.html của Angular Material 14.2.7 với src/example/form-field-appearance-example.html và src/index.html của 16.2.1. Xác nhận hành vi của khoảng trắng ở đầu trong mat-hint và mat-error, sau đó kiểm tra rằng hành vi mong đợi được khôi phục mà không làm hỏng căn chỉnh nhiều 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
Khá rõ ràng
Mức phù hợp với người mới
35/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.