Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lastValue whenever ngModel property update programmatically #1042

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Atifarooq
Copy link

@Atifarooq Atifarooq commented Jun 12, 2021

Scenario:

  • We have two textbox bind with ngModel properties respectively and (ngModelChange) event bind to these.

  • On change in first textbox value need to update second textbox ngModel property which is reflecting.
    (when you have update ngModel property programmatically then it trigger writeValue function but not update the lastValue hence then you change the ngModel value and its not triggered this._onChange();).

  • But After programmatically update value, when remove the value from second textbox (ngModelChange) will not trigger because this.lastValue has not been updated in previous writeValue function.

Issue Produced StackBlitz Please have a look and follow the steps to produce it.

Scenario:
- We have two textbox bind with ngModel properties respectively and (ngModelChange) event bind to these.
- On change in first textbox value need to update second textbox ngModel property which is reflecting.
   (when you have update ngModel property programmatically then it trigger write function but not update the last value hence then you change the ngModel value and its not 
     triggered this._onChange();).
- But After programmatically update value, when remove the value from second textbox (ngModelChange) will not trigger because this.lastValue  has not been updated in previous writeValue function.
@Atifarooq
Copy link
Author

Please review this single line PR as its must needed for our product. We are using this package v8.0.2 and version update will cost whole application update and test cycles. Hence this PR merge give us major relief and solve our bug scenario.

@travist / @brandensilva / @mzedeler / @josemarluedke

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant