Skip to content

Commit

Permalink
call super.connectedCallback after setting attributes to prevent infi…
Browse files Browse the repository at this point in the history
…nite loop

Signed-off-by: Wouter Vroege <[email protected]>
  • Loading branch information
woutervroege committed May 14, 2021
1 parent 07a9293 commit 803a43c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reflected-properties-mixin.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export const ReflectedProperties = (SuperClass) => class extends SuperClass {

connectedCallback() {
super.connectedCallback();
for(var i in this.constructor.reflectedProperties) {
const propName = this.constructor.reflectedProperties[i];
const attrName = this.constructor.__getAttributeNameByPropertyName.call(this, propName);
this.constructor.__setDOMAttribute.call(this, attrName, propName, this[propName]);
}
super.connectedCallback();
}

propertyChangedCallback(propName, oldValue, newValue) {
Expand Down

0 comments on commit 803a43c

Please sign in to comment.