polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

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

Open jessevanassen opened this issue 2 years ago • 4 comments

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.

jessevanassen avatar Aug 22 '23 07:08 jessevanassen

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 avatar Aug 23 '23 02:08 justinfagnani

ah, I don't have permissions to push.

justinfagnani avatar Aug 23 '23 02:08 justinfagnani

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.

jessevanassen avatar Aug 23 '23 06:08 jessevanassen