angular / angular/components

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

未关闭
#20,218 22 条评论 34 个 reaction 已指派 0 人 在 GitHub 查看
area: material/datepicker needs: discussion P4
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

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

贡献指南

打开贡献指南

调研方向

打开链接的 StackBlitz 复现,并检查 src/app/example-component.ts。点击 "emitEvent: false" 按钮,将 date-picker 的行为与文本输入框和 select 进行比较,并跟踪 valueChanges 的发出情况。当使用 emitEvent: false 调用 setValue 和 patchValue 时,date-picker 不产生任何 valueChanges 发出,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。