NG-ZORRO / ng-zorro-antd-mobile

A configurable Mobile UI components based on Ant Design Mobile and Angular. 🐜
http://ng.mobile.ant.design
Other
799 stars 241 forks source link

fix(module: textarea-item) fix ngModel #887

Open sharky559 opened 1 year ago

sharky559 commented 1 year ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: N/A

When a textarea is entered with a value, this._onChange is triggered in both of the following places, which causes the value of the form control to be triggered twice, leading to a number of problems

image image

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

aijunhao commented 1 year ago

I'm sorry, I can't reproduce the problem you mentioned. Can you give me a demo on StackBlitz?

sharky559 commented 10 months ago

I'm sorry, I can't reproduce the problem you mentioned. Can you give me a demo on StackBlitz?

When the value of the textarea input changes, you can see that the ngModelChange method is triggered twice, which doesn't look quite normal. https://stackblitz.com/edit/angular-hrkf1c?file=src%2Fapp%2Fapp.component.ts