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

can-value becomes out of sync when a compute rejects the new value #887

Closed
matthewp opened this issue Apr 16, 2014 · 0 comments
Closed

can-value becomes out of sync when a compute rejects the new value #887

matthewp opened this issue Apr 16, 2014 · 0 comments
Labels
Milestone

Comments

@matthewp
Copy link
Contributor

http://jsfiddle.net/6PeBb/1/

This demo includes a compute that rejects non-numbers. If you type in a non-number value the compute's setter will return the old value.

This means the <input> and the compute are not in sync.

matthewp added a commit to matthewp/canjs that referenced this issue Apr 16, 2014
This change ensures that when the compute value is set due to a user
typing into an input, that the input's value is checked against the new
value and that they are the same. Otherwise it is possible for the
compute to reject the input's value (or set it to something else
entirely) and the input and compute value become out of sync. Fixes canjs#887
matthewp added a commit to matthewp/canjs that referenced this issue Apr 16, 2014
This change ensures that when the compute value is set due to a user
typing into an input, that the input's value is checked against the new
value and that they are the same. Otherwise it is possible for the
compute to reject the input's value (or set it to something else
entirely) and the input and compute value become out of sync. Fixes canjs#887
@ccummings ccummings added this to the 2.2.0 milestone Apr 29, 2014
@ccummings ccummings added the Bug label May 7, 2014
cklanac added a commit that referenced this issue Feb 13, 2015
@cklanac cklanac closed this as completed Feb 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants