NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.85k stars 3.9k forks source link

[select ]当设置FormControl的updateOn=’blur‘属性时会延迟触发ngModelChange事件 #6255

Open XSharn opened 3 years ago

XSharn commented 3 years ago

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-ivy-m2rzff?file=src/app/app.component.ts

Steps to reproduce

选择以后观察value的值

What is expected?

选择完了以后值会变

What is actually happening?

https://stackblitz.com/edit/ng-zorro-antd-ivy-m2rzff?file=src/app/app.component.ts 当设置FormControl的updateOn=’blur‘属性时会延迟触发ngModelChange事件

Environment Info
ng-zorro-antd 10.2.2
Browser chrome

是不是select不支持updateOn 属性

zorro-bot[bot] commented 3 years ago

Translation of this issue:

[SELECT] When setting formControl's updateon = 'blur' attribute, the NGModelchange event is delayed.

reproduction link

[https://stackblitz.com/Edit/ng- Zorro-antd-ivy-m2rzff?file=src/app/app.component.ts](https://stackblitz.com/edit/ng-zorro-antd- Ivy-m2rzff? file = src / app/ app.component.ts)

steps to reproduce

Select the value of Value after selecting

What is expected?

After the selected value will change

What is actually happens?

https://stackblitz.com/edit/ng-zorro-antd-ivy-m2rzff?file=src/app/app.component.ts Trigger NGModelchange event when setting formControl's updateon = 'blur' attribute

ENVIRONMENT INFO
Ng-Zorro-ANTD 10.2.2
Browser Chrome

Is it SELECT does not support Updateon properties

to0simple commented 3 years ago

延迟不太准确吧,应该是再次失去焦点时值变成了第一次你要选取的值。