-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
HTML5 property: valueAsNumber - is this supported? #2322
Comments
I'm sure a good chunk of the code below came from SO, here or the newsgroup. Anyway, here's what we use in our project.
|
Thanks, I will try it! But still I would prefer direct support of HTML5 numeric fields. |
It is not as trivial as you might think. |
I just came across the issue that if I have an HTML5 input element with
type
set tonumber
anddata-bind="textInput ..."
then the resulting binding value is a string. I would like to avoid converting each single string to a number as this would trigger all dependent subscriptions of the observables and lead to recursive calls. As a workaround I followed these instructions use enable the valueAsNumber property within the ko.selectExtensions.readValue function that is used by thevalue
binding.Unfortunaltey I don't know how to do the same with the
textInput
binding, and therefore I would like to know if such an integration is planned for future.The text was updated successfully, but these errors were encountered: