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
Attribute reset() fails if initial value does not pass the validator #1208
Comments
Hm, it feels a little bit weird for me, since if you have the validator, I'd imagine you'd expect that the value there would either pass the validator or be undefined. I see what you mean in your case, though, and I think it is something that probably should be fixed. What if we set it so that if you didn't specify a value property in |
Yeah that will probably be the best solution. I agree it sound weird. But as my usercase showed, i need a way to go to initial (or undefined) values again. Thanks for picking it up. Marco. |
In that case, I think you would just remove the I'll work on a patch for that in a bit, cheers! |
To show a use case: http://gallerydocs.itsasbreuk.nl/gallery-itsaviewmodelpanel/form-without-buttons.html Marco. |
This seems the right thing, but IMO is not.
It is very common to have an initial value that is undefined while having a validator that is restrictive. The thing is, when a user enters a valid value for the attribute, the reset() function DOES NOT clear its value (because value===null does not pass validation).
I have a situation like described below and it gives very unpleasant behaviour:
See the jsbin:
http://jsbin.com/opEGOHE/1/
I hope you feel like changing it.
Regards,
Marco.
The text was updated successfully, but these errors were encountered: