Skip to content

Commit 2db78f3

Browse files
committed
Only trigger attributeChangedCallback on toggleAttribute if the value changed
1 parent e858c54 commit 2db78f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/scoped-custom-element-registry/src/scoped-custom-element-registry.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ if (!ShadowRoot.prototype.createElement) {
354354
const old = this.getAttribute(name);
355355
toggleAttribute.call(this, name, force);
356356
const newValue = this.getAttribute(name);
357-
attributeChangedCallback.call(this, name, old, newValue);
357+
358+
if (old !== newValue) {
359+
attributeChangedCallback.call(this, name, old, newValue);
360+
}
358361
} else {
359362
toggleAttribute.call(this, name, force);
360363
}

0 commit comments

Comments
 (0)