angular / angular/components

Setting a single formControl to Untouched does not reset the error css state

Đang mở
#14,289 8 bình luận 1 reaction 0 người được giao Xem trên GitHub
area: material/form-field P4
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ả

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
Don't use mat-form-field-invalid, but use the native angular core css classes ng-invalid
Because mat-form-field-invalid does not get removed when setting a single formControl to untouched

#### What is the current behavior?
mat-form-field-invalid does not get removed when doing markAsUntouched

#### What are the steps to reproduce?
Providing a StackBlitz reproduction is the *best* way to share your issue.

StackBlitz starter: https://goo.gl/wwnhMV

On every simple form

#### What is the use-case or motivation for changing an existing behavior?
Material uses it's own mat-form-field-invalid css class instead of the angular core css classes, this makes error. This is a wrong design

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
newest versions

#### Is there anything else we should know?

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 StackBlitz được liên kết và theo dõi cách markAsUntouched ảnh hưởng đến trạng thái lỗi của trường biểu mẫu Material so với các lớp form-control gốc của Angular. Xác nhận hành vi trên một biểu mẫu đơn giản, sau đó kiểm tra rằng việc đánh dấu một control là untouched sẽ loại bỏ kiểu hiển thị không hợp lệ tương ứng mà không thay đổi các control khác.

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ần làm rõ
Mức phù hợp với người mới
38/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.