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
This behavior is by design. When element declarations are loaded lazily via HTML imports, it's necessary to wait for the declarations to register and for existing elements to upgrade. In general, the callback method in Polymer.Base.importHref can be used as a ready signal. For example, here's a working version of the code posted above:
While it's true that Polymer could attempt to save and re-apply property values that were set prior to element registration/upgrade, this could not be done for methods, and we've chosen instead to avoid trying to sugar over the general issue that elements can exist in 2 states: un-upgraded and upgraded. User code should be written such that it deals with this fact.
@sorvell Although I might agree about not running accessors with previous property values, I think it should not prevent the accessor not working at all if the property was set, because the component remains unusable if the user has set some property previously. Thus imho, when accessors are configured, if not reapplied it should delete previous property values, so as new accessors are usable.
If we create an element and set some properties previously to being initialized like in the following example:
then in console line
selector.selected = 2;
does nothing.Cause: own property in the selector overrides the property with setter and getter in behavior (
IronSelectableBehavior
).The same issue happens with many other elements as well.
The text was updated successfully, but these errors were encountered: