Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngModel): do not dirty the input if nothing was changed #7495

Closed
wants to merge 1 commit into from
Closed

fix(ngModel): do not dirty the input if nothing was changed #7495

wants to merge 1 commit into from

Conversation

shahata
Copy link
Contributor

@shahata shahata commented May 17, 2014

This caused the input to become dirty every time $commitViewValue was called, even if no update to the view value was made. For example, updateOn triggers and form submit may call $commitViewValue without updating the view value.

Closes #7457

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7495)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@shahata
Copy link
Contributor Author

shahata commented May 17, 2014

I'm not sure that this is the correct approach to handle this. @petebacondarwin - would appreciate your opinion on this.

This caused the input to become dirty every time `$commitViewValue` was called, even if no update to the view value was made. For example, `updateOn` triggers and form submit may call `$commitViewValue` without updating the view value.

Closes #7457
@petebacondarwin
Copy link
Contributor

LGTM

@petebacondarwin
Copy link
Contributor

Can't think of a better approach

@shahata
Copy link
Contributor Author

shahata commented May 17, 2014

👍

@IgorMinar
Copy link
Contributor

lgtm

RichardLitt pushed a commit to RichardLitt/angular.js that referenced this pull request May 24, 2014
…as changed

Calling `$commitViewValue` was was dirtying the input, even if no update to the view
value was made.
For example, `updateOn` triggers and form submit may call `$commitViewValue` even
if the the view value had not changed.

Closes angular#7457
Closes angular#7495
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

form and input is getting dirty by clicking on a simple button
4 participants