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

Published property with default value not reflected #509

Closed
arthurevans opened this issue May 19, 2014 · 2 comments
Closed

Published property with default value not reflected #509

arthurevans opened this issue May 19, 2014 · 2 comments

Comments

@arthurevans
Copy link

If I create a published property with a default value and reflect: true, the property isn't reflected as an attribute until I change the property. Test case here:

http://jsbin.com/sogon/7/edit

The text here should show up in red (and the should show up as in devtools), but it doesn't.

If you use devtools to change the highlight value to 'red', nothing happens -- apparently we detect that the value hasn't changed and don't serialize it.

If you change it to another value then back to red, it works.

Currently, you can work around this by just setting reflect: true in the publish block and setting the default value in the ready callback. But it seems like the default value should reflect correctly.

@sjmiles
Copy link
Contributor

sjmiles commented May 21, 2014

No standard element reflects the default value of an attribute. If that was the case, the runtime DOM would explode with attributes.

If there is a bug, it's probably that it ever reflects a value that matches the prototype default.

@arthurevans
Copy link
Author

This is documented as the current behavior:
http://www.polymer-project.org/docs/polymer/polymer.html#attrreflection

Closing issue.

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

2 participants