Skip to content
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

[0.8] Properties deserialized from native inputs lose their type #1396

Closed
garlicnation opened this issue Apr 10, 2015 · 2 comments
Closed

[0.8] Properties deserialized from native inputs lose their type #1396

garlicnation opened this issue Apr 10, 2015 · 2 comments

Comments

@garlicnation
Copy link
Contributor

Bind a number-valued property to native input, change the input, the property is now a string.

Demo:
http://garlicnation.github.io/polymer/demo/
https://github.com/garlicnation/polymer/tree/nativeInputTypes/demo

A workaround would be to add some indirection when setting the property w/ a change handler function, but I don't see anything in our documentation capturing this behavior.

@zhaoz
Copy link
Contributor

zhaoz commented Apr 10, 2015

I was told that I could set type="number" for the , however I tried that in a similar demo to the one garlicnation posted and was not able to get it to work.

@sorvell
Copy link
Contributor

sorvell commented May 22, 2015

Polymer does not deserialize or type check property assignments. In this case, the <input> element always produces value as a string (e.g. http://jsbin.com/dicosi/1/edit?html,console,output).

Users can, of course, implement this type of type validation/conversion, if desired.

@sorvell sorvell closed this as completed May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants