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

Comments

Projects
None yet
5 participants
@matthewp
Contributor

matthewp commented Apr 16, 2014

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

Ensure can-value bound input stay in sync with compute
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 #887

matthewp added a commit to matthewp/canjs that referenced this issue Apr 16, 2014

Ensure can-value bound input stay in sync with compute
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 #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 Feb 13, 2015

@daffl daffl removed the fixed in branch label Feb 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment