* Removes all children from the slot and detaches listeners, if any * @private
(slotName: string, slotData: SlotMetadata)
| 621 | * @private |
| 622 | */ |
| 623 | _clearSlot(slotName: string, slotData: SlotMetadata) { |
| 624 | const propertyName = slotData.propertyName || slotName; |
| 625 | const children = this._state[propertyName] as Array<SlotValue>; |
| 626 | |
| 627 | children.forEach(child => { |
| 628 | if (instanceOfUI5Element(child)) { |
| 629 | const childChangeListener = this._getChildChangeListener(slotName); |
| 630 | child.detachInvalidate.call(child, childChangeListener); |
| 631 | } |
| 632 | |
| 633 | if (child instanceof HTMLSlotElement) { |
| 634 | this._detachSlotChange(child, slotName); |
| 635 | } |
| 636 | }); |
| 637 | |
| 638 | this._state[propertyName] = []; |
| 639 | this._state[kebabToCamelCase(propertyName)] = this._state[propertyName]; |
| 640 | } |
| 641 | |
| 642 | /** |
| 643 | * Attach a callback that will be executed whenever the component is invalidated |
nothing calls this directly
no test coverage detected
searching dependent graphs…