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
Binding structured data with undefined sub-properties into an element results in undefined being set to the property in question; typically we only expect undefined values transiently at startup, since they should either become valued by attributes in markup, bindings from above, or default values, and Polymer avoids calling multi-property observers until all dependencies become valued.
However, in the case of bindings to structured data, if a new object is set with undefined properties, this results in the element receiving undefined at runtime and may not properly react to this change in state.
See http://jsbin.com/cejusi/edit?html,output for repro, where dom-if receives undefined but since its observer is multi-prop, it waits until it becomes defined.
One idea is to explicitly trap the case that undefined is being set to a Polymer element property and convert that to the element's default value for the property, if it exists.
The text was updated successfully, but these errors were encountered:
Alternatively object sub-properties could be treated as null. This would indicate a value has been set causing observers to fire without requiring a default value to be set.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed after being marked stale. If you're still facing this problem with the above solution, please comment and we'll reopen!
Binding structured data with
undefined
sub-properties into an element results inundefined
being set to the property in question; typically we only expectundefined
values transiently at startup, since they should either become valued by attributes in markup, bindings from above, or default values, and Polymer avoids calling multi-property observers until all dependencies become valued.However, in the case of bindings to structured data, if a new object is set with undefined properties, this results in the element receiving
undefined
at runtime and may not properly react to this change in state.See http://jsbin.com/cejusi/edit?html,output for repro, where
dom-if
receivesundefined
but since its observer is multi-prop, it waits until it becomes defined.One idea is to explicitly trap the case that
undefined
is being set to a Polymer element property and convert that to the element's default value for the property, if it exists.The text was updated successfully, but these errors were encountered: