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
Binding JSON number type converts to string upon edit #287
Comments
yeah i also recognised that.
would be cool if the binding system would automatically do that because if i bind an integer i also expect an integer back... |
We have some ideas about how this could be done in the future. The basic problem is that inputs of type text coerce the value to string, which is out of our control. But we have some ways we think we can help do it on the model side. |
ok good to know |
@fopsdev check out aurelia/templating-resources#160 (comment) @brettveenstra we're tracking this one in aurelia/templating#96 |
thanks for the reference @jdanyow |
While trying to implement an object comparison (using the areEqual function from the app-contacts project), discovered that once a number property is bound and edits applied (input type=text), it mutates to a string, breaking straight-forward comparison efforts.
The binding infrastructure seems to be the place to address this effect, maybe the ShadowDOM?
Here's some example code:
So changes to
balanceThreshold
orcustomerNo
trigger a the call back but the isDirty will always staytrue
.The text was updated successfully, but these errors were encountered: