angular / angular/components

bug(MatDatePicker): change events emitted despite using emitEvents false

Đang mở
#20,218 22 bình luận 34 reaction 0 người được giao Xem trên GitHub
area: material/datepicker needs: discussion 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ả

#### Reproduction

https://stackblitz.com/edit/components-issue-xay9ty?file=src%2Fapp%2Fexample-component.ts

1. Click the "emitEvent: false" button

#### Expected Behavior

`valueChanges` should not emit values when setting a value with `emitEvent: false`

This works correctly for "normal" input components, but not when attaching a date picker.

The reproduction includes a text input and a select for comparison.

#### Actual Behavior

Using `setValue` or `patchValue` with `emitEvent` set to `false` has the `valueChanges` observable emit changes.

#### Environment

- Angular: 10.0.3
- CDK/Material: 10.0.3
- Browser: Chrome
- Operating System: Windows

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

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

Hướng nghiên cứu

Mở bản tái hiện StackBlitz được liên kết và kiểm tra src/app/example-component.ts. Nhấp vào nút "emitEvent: false", so sánh hành vi của date-picker với ô nhập văn bản và select, rồi theo dõi các lần phát valueChanges. Hoàn tất khi setValue và patchValue với emitEvent: false không tạo ra lần phát valueChanges nào cho date-picker.

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
45/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.