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

When an attribute and property are present at upgrade time, property should win #3779

Closed
kevinpschaaf opened this issue Jul 12, 2016 · 0 comments

Comments

@kevinpschaaf
Copy link
Member

Description

If both an attribute and its associated property are set at upgrade time, the property value should win.

The current Polymer behavior is (unexpectedly) that attributes take precedence over properties. Based on the fact that attributes should generally be used for static initial configuration, and properties for dynamic changes thereafter, it is reasonable to assume that in the case an element has both an attribute and a property at upgrade time, the property was likely set last and should take precedence.

Normally with Polymer data-binding, the state of having both an attribute value and a property value at startup never happens since binding annotations are removed from attribute values before the element upgrades. However, other data-binding systems may leave stale data or even binding annotations in the attribute, but proceed to update property values.

Live Demo

The issue came up in the context of this Angular1+Polymer demo:
https://plnkr.co/edit/F95ascEJWCtAP1xxmbKP?p=preview

Steps to Reproduce

Open the Plunkr

Expected Results

Polymer values are correct.

Actual Results

On Chrome, the Polymer values are displayed as expected.
On polyfill, the Polymer values are wrong.

Browsers Affected

All, although the particular incantation shown in the Plunkr above affects CE polyfilled browsers.

Versions

  • Polymer: v1.6.0
  • webcomponents: v0.7.22
@kevinpschaaf kevinpschaaf changed the title When an attribute and property are present at configuration time, property should win When an attribute and property are present at upgrade time, property should win Jul 12, 2016
sorvell pushed a commit that referenced this issue Jul 22, 2016
Ensure properties override attributes at upgrade time. Fixes #3779.
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

1 participant