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

input with can-value keeps wrong value prevented with setter plugin #872

Closed
whitecolor opened this Issue Apr 5, 2014 · 1 comment

Comments

Projects
None yet
3 participants
@whitecolor
Contributor

whitecolor commented Apr 5, 2014

http://jsfiddle.net/xKc3H/332/

The code shows that if after change of value in input setter prevents attribute change, value in the input stays the same (not equal to attribute value). I believe it is wrong behavior.

var map = new can.Map({

    number: 10,

    setNumber: function(val){
        // change attribute only if positive value
        if (parseInt(val) > 0){
            return parseInt(val)
        }
    }
})

$('body').append(can.view.mustache('<input can-value="number"/>{{number}}')(map))

@ccummings ccummings added the Duplicate label May 16, 2014

@ccummings

This comment has been minimized.

Show comment
Hide comment
@ccummings

ccummings May 16, 2014

Contributor

Same issue as #887 which has a fix in PR #888.

Closing this issue since all the activity for the fix is in the other issue.

Contributor

ccummings commented May 16, 2014

Same issue as #887 which has a fix in PR #888.

Closing this issue since all the activity for the fix is in the other issue.

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