File tree Expand file tree Collapse file tree 4 files changed +18
-25
lines changed
engine-server/src/__tests__/fixtures/slots-basic/implicit-no-template/shadow Expand file tree Collapse file tree 4 files changed +18
-25
lines changed Original file line number Diff line number Diff line change 11< x-outer >
2- < x-inner >
3- < template shadowrootmode ="open ">
4- </ template >
5- slotted content
6- < h2 slot ="bob ">
7- more content
8- </ h2 >
9- </ x-inner >
2+ < template shadowrootmode ="open ">
3+ < x-inner >
4+ < template shadowrootmode ="open ">
5+ </ template >
6+ I am default slot
7+ < div slot ="foo ">
8+ I am the foo slot
9+ </ div >
10+ </ x-inner >
11+ </ template >
1012</ x-outer >
Original file line number Diff line number Diff line change 11< template >
22 < x-inner >
3- slotted content
4- < h2 slot ="bob " > more content </ h2 >
3+ I am default slot
4+ < div slot ="foo " > I am the foo slot </ div >
55 </ x-inner >
66</ template >
Original file line number Diff line number Diff line change 11import { LightningElement } from 'lwc' ;
22
3- export default class extends LightningElement {
4- static renderMode = 'light' ;
5- }
3+ export default class extends LightningElement { }
Original file line number Diff line number Diff line change @@ -109,7 +109,9 @@ export function* fallbackTmpl(
109109) {
110110 if ( Cmp . renderMode !== 'light' ) {
111111 yield `<template shadowrootmode="open"></template>` ;
112- renderSlottedContent ( _lightSlottedContent , _instance ) ;
112+ if ( _shadowSlottedContent ) {
113+ yield _shadowSlottedContent ( _instance ) ;
114+ }
113115 }
114116}
115117
@@ -123,17 +125,8 @@ export function fallbackTmplNoYield(
123125) {
124126 if ( Cmp . renderMode !== 'light' ) {
125127 emit ( `<template shadowrootmode="open"></template>` ) ;
126- renderSlottedContent ( _lightSlottedContent , emit ) ;
127- }
128- }
129-
130- function renderSlottedContent ( _lightSlottedContent : any , contextfulParent : any ) {
131- if ( _lightSlottedContent ) {
132- for ( const slotName in _lightSlottedContent ) {
133- const generators = _lightSlottedContent [ slotName ] ;
134- for ( let i = 0 ; i < generators . length ; i ++ ) {
135- generators [ i ] ( contextfulParent , null , slotName ) ;
136- }
128+ if ( _shadowSlottedContent ) {
129+ _shadowSlottedContent ( emit , _instance ) ;
137130 }
138131 }
139132}
You can’t perform that action at this time.
0 commit comments