three-elements
three-elements copied to clipboard
BaseElement.setAttribute should track super.setAttribute succes/failure
Hello
This is a (very) small issue though, but reading this lines in file : https://github.com/hmans/three-elements/blob/a580feb5f1c537d19387c3630703734c5f835644/packages/three-elements/src/BaseElement.ts#L115-L118
... I assume wrong arguments can be given (like wrong attributeName) for the native impl. to throw an error.
In this case, the attributeChangedCallback will be called even the actual attribute set is not terminated...
Easy solution: invert the 2 lines, so the callback would not be fired if an error occured. Less easy solution: Encapsulate the super call in a try/catch and call the callback only in case of success, and manage the error case...