webcomponents / polyfills

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

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

Open jessevanassen opened 10 months ago

jessevanassen commented 10 months 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 10 months 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 10 months ago

ah, I don't have permissions to push.

jessevanassen commented 10 months 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.