Skip to content

Commit

Permalink
Only trigger attributeChangedCallback on toggleAttribute if the value…
Browse files Browse the repository at this point in the history
… changed
  • Loading branch information
jessevanassen committed Aug 22, 2023
1 parent e858c54 commit 2db78f3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ if (!ShadowRoot.prototype.createElement) {
const old = this.getAttribute(name);
toggleAttribute.call(this, name, force);
const newValue = this.getAttribute(name);
attributeChangedCallback.call(this, name, old, newValue);

if (old !== newValue) {
attributeChangedCallback.call(this, name, old, newValue);
}
} else {
toggleAttribute.call(this, name, force);
}
Expand Down

0 comments on commit 2db78f3

Please sign in to comment.