You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the problem is the following:
i have a webcomponent which uses slots. And i want to detect when there is a change in those slots, especially in attributes and the inner text of the elelment. i want to catch this change and refresh my web-component
but currently the slotChange event is only triggered when the slot attribute is changed, which is very limited.
there is a workaround being the use of the MutationObserver assigned to the webComponent root (not shadow root!).
The text was updated successfully, but these errors were encountered:
I'm sure there are some existing issues on this topic. It's very often been requested to be able to observe changes in children, whether projected or not.
if yes feel free to link it.
but for slots it's the most common thing to do that the component get's updated when the children do.
however if there is something like a "slotChange" event and it is not fired if the slot is changed... then i would at least thing it is a syntactical bug.
if it is intended that this event is only called on the change of the assigned elements list without any context about anything else, then call it "slotAdded" or "elementAdded" or "rangeUpdated" or so.
hello,
first: i was pointed here by this bug, i created:
https://bugzilla.mozilla.org/show_bug.cgi?id=1724680
the problem is the following:
i have a webcomponent which uses slots. And i want to detect when there is a change in those slots, especially in attributes and the inner text of the elelment. i want to catch this change and refresh my web-component
but currently the slotChange event is only triggered when the slot attribute is changed, which is very limited.
there is a workaround being the use of the MutationObserver assigned to the webComponent root (not shadow root!).
The text was updated successfully, but these errors were encountered: