Skip to content

Commit

Permalink
fix: only remove slot children in synthetic shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed May 19, 2022
1 parent 6812585 commit 8cfee1c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/@lwc/engine-core/src/framework/rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ function unmount(vnode: VNode, parent: ParentNode, doRemove: boolean = false) {
removeNode(elm!, parent);
}

const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
// Slot content is removed to trigger slotchange event when removing slot.
// Only required for synthetic shadow.
const removeChildren = sel === 'slot' && vnode.owner.shadowMode === ShadowMode.Synthetic;
switch (type) {
case VNodeType.Element:
unmountVNodes(vnode.children, elm as ParentNode, removeChildren);
Expand Down

0 comments on commit 8cfee1c

Please sign in to comment.