- From: Joe Pea <notifications@github.com>
- Date: Fri, 24 Jul 2020 16:35:41 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 24 July 2020 23:35:54 UTC
If I have a custom element like
```js
class MyEl extends HTMLElement {
static observedAttributes = ['style']
attributeChangedCallback(attr, oldVal, newVal) { console.log(attr, oldVal, newVal) }
}
customElements.define('my-el', MyEl)
```
I noticed that, in Chrome for example, if I run
```js
el.setAttribute('style', 'block')
```
`attributeChangedCallback` is called and I see console output.
However if I run
```js
el.attributeStyleMap.set('display', new CSSKeywordValue('block'))
```
then `attributeChangedCallback` is not fired and I see no output. However, I can see the attribute is updated in the element inspector and I can call `el.getAttribute('style')` and see the new value.
Is this expected?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/890
Received on Friday, 24 July 2020 23:35:54 UTC