webcomponents / polyfills

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

Added `toggleAttribute` to patched methods to make sure `attributeC… #510

Closed DannyMoerkerke closed 2 years ago

DannyMoerkerke commented 2 years ago

Added toggleAttribute to patched methods to make sure attributeChangedCallback is executed when it is called

When this polyfill is used and an attribute of a Custom Element is added or removed through toggleAttribute, the attributeChangedCallback method is not called.

This PR adds toggleAttribute to the patched methods so attributeChangedCallback is executed when toggleAttribute is called.

daKmoR commented 2 years ago

@kevinpschaaf can I ask you to take a look 🤗

anything missing?

PS: no added tests as there are no existing tests for attributes? 🤷‍♂️