AmpersandJS / ampersand-input-view

A view module for intelligently rendering and validating input. Works well with ampersand-form-view.
MIT License
17 stars 19 forks source link

compare string versions in changed handler #22

Closed lukekarrys closed 10 years ago

lukekarrys commented 10 years ago

In cases where you created an input view without a value and then later set the input to an empty string, it would report as changed which I don't think is what we want.

Minor issue, but figured I'd give it a fix and a test.

HenrikJoreteg commented 10 years ago

I agree it's a problem, not crazy about the fix at first glance. Seems like we could set the default to empty string or something instead. Not sure. The getString thing just feels a bit too hackish, IMO.

lukekarrys commented 10 years ago

@HenrikJoreteg I changed it so that when we set inputValue and startingValue we setting them to empty strings if they are falsy (and not 0) and not doing that inside the derived property.

HenrikJoreteg commented 10 years ago

looks good to me