ui5-webcomponents
ui5-webcomponents copied to clipboard
feat(UI5Element): invalidateOnChildChange works for slots
Currently, the slot metadata setting invalidateOnChildChange only works for directly slotted UI5 Elements inside the slot.
This change enables the functionality for transitively slotted children too. This is relevant for <ui5-multi-input> which uses internally <ui5-tokenizer> and the <ui5-token>s are transitively slotted from the MultiInput to the Tokenizer, and finally the Tokenizer gets each token wrapped in a <slot> element.
Notes:
- the
_getChildChangeListenermethod's return value is always truthy, it doesn't need to be checked - unfortunately the
slotchangeevent does not provide information on added/removed nodes (unlike f.e.MutationObserver), therefore aWeakMapis used to store all children per slot betweenslotchangecalls.
related to: https://github.com/SAP/ui5-webcomponents/pull/9005