Skip to content

Commit 7556d0c

Browse files
fix forwarded dangling slots (#5164)
* fix: add dangling slot definition * fix: scoped slot case, nested cases * fix: review comments * fix: additional test * fix: clarified dangling slot explanation
1 parent 2269119 commit 7556d0c

File tree

22 files changed

+118
-16
lines changed

22 files changed

+118
-16
lines changed

packages/@lwc/engine-server/src/__tests__/fixtures/slot-forwarding/slots/dangling-component/error.txt

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<x-dangling-container>
2+
<x-slot>
3+
<x-leaf>
4+
<!---->
5+
<x-component slot="dangling">
6+
Component content
7+
</x-component>
8+
<!---->
9+
<!---->
10+
<x-component>
11+
Component content
12+
</x-component>
13+
<!---->
14+
</x-leaf>
15+
</x-slot>
16+
</x-dangling-container>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const tagName = 'x-dangling-container';
2+
export { default } from 'x/container';
3+
export * from 'x/container';
4+
export const features = [];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<template lwc:render-mode="light">
2+
Component content
3+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
static renderMode = 'light';
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template lwc:render-mode="light">
2+
<x-slot>
3+
<x-component slot="top"></x-component>
4+
<x-component slot="bottom"></x-component>
5+
</x-slot>
6+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
static renderMode = 'light';
5+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<template lwc:render-mode="light">
2+
<slot name="leafTop" slot="dangling"></slot>
3+
<slot name="leafBottom"></slot>
4+
</template>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { LightningElement } from 'lwc';
2+
3+
export default class extends LightningElement {
4+
static renderMode = 'light';
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<template lwc:render-mode="light">
2+
<x-leaf>
3+
<slot name="top" slot="leafTop"></slot>
4+
<slot name="bottom" slot="leafBottom"></slot>
5+
</x-leaf>
6+
</template>

0 commit comments

Comments
 (0)