If we define a property like this on a color-span
custom element:
static get observedAttributes() {
return ['bgc'];
}
And get a reference to an instance like this while also changing the bgc property, should that cause the attributeChangedCallback
to fire?
const colorSpan = document.querySelector('color-span');
console.log(colorSpan);
colorSpan.bgc = 'BLUE';
I tried it in this demo, and it does not fire, so I just wanted to confirm my understanding that the attributeChangedCallback
will only fire when an attribute is set declaratively like this:
<color-span bgc="RED">Hello From Color Span</color-span>