When Element.statics were added, there were some new calls to node.setAttribute() added BEFORE defineProperty(node, '_ractive', ...) was called. This is breaking our attributeChangedCallback() handler, since the handler tries to call Ractive.getContext(this) to get the parent Ractive, which is now failing.
Unless there's a good reason for it to be before the defineProperty(node, '_ractive', ...) call, the fix should be as easy as moving the following block of code to be after the defineProperty(node, '_ractive', ...) call (see src/view/items/Element.js):
if (this.statics) {
keys(this.statics).forEach(k => {
node.setAttribute(k, this.statics[k]);
});
}
Description:
When
Element.statics
were added, there were some new calls tonode.setAttribute()
added BEFOREdefineProperty(node, '_ractive', ...)
was called. This is breaking ourattributeChangedCallback()
handler, since the handler tries to callRactive.getContext(this)
to get the parentRactive
, which is now failing.Unless there's a good reason for it to be before the
defineProperty(node, '_ractive', ...)
call, the fix should be as easy as moving the following block of code to be after thedefineProperty(node, '_ractive', ...)
call (see src/view/items/Element.js):Versions affected:
Everything after this commit: special case handling for plain text attributes
Platforms affected:
Google Chrome and any other browser if a custom element polyfill is used
Reproduction:
playground example