webcomponents / polyfills

Web Components Polyfills
BSD 3-Clause "New" or "Revised" License
1.15k stars 165 forks source link

[scoped-custom-element-registry] Toggle attribute should only trigger attributechangedcallback on change #557

Open jessevanassen opened 1 year ago

jessevanassen commented 1 year ago

Fixes #556.

I fixed this by only triggering the attributeChangedCallback if the attribute's value was actually different. I've also added a test to assert the behavior.

There were no tests to assert the behavior of attributeChangedCallback in combination with setAttribute, removeAttribute and toggleAttribute, so I've added additional tests for this as well.

justinfagnani commented 1 year ago

Looks good, but there's a formatting error on the changelog. I'm going to see if I can push to your branch to fix.

*wow, that's a long branch name! my terminal's having trouble with it.

justinfagnani commented 1 year ago

ah, I don't have permissions to push.

jessevanassen commented 1 year ago

Thanks for the quick response and the pointers to fix it @justinfagnani! Apologies for the formatting issue in the changelog. Fixed it, and rebased the branch so it's up to date with master.