You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered:
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
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
The text was updated successfully, but these errors were encountered: