File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
src/compiler/compile/nodes
test/runtime/samples/slot-in-dynamic-element Expand file tree Collapse file tree 4 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' svelte ' : patch
3+ ---
4+
5+ fix: allow child element with slot attribute within svelte: element
Original file line number Diff line number Diff line change @@ -1413,7 +1413,9 @@ const regex_minus_sign = /-/;
14131413function within_custom_element ( parent ) {
14141414 while ( parent ) {
14151415 if ( parent . type === 'InlineComponent' ) return false ;
1416- if ( parent . type === 'Element' && regex_minus_sign . test ( parent . name ) ) return true ;
1416+ if ( parent . type === 'Element' ) {
1417+ if ( regex_minus_sign . test ( parent . name ) || parent . is_dynamic_element ) return true ;
1418+ }
14171419 parent = parent . parent ;
14181420 }
14191421 return false ;
Original file line number Diff line number Diff line change 1+ export default {
2+ html : `
3+ <dynamic-element>
4+ <header slot='header'>header header header</header>
5+ </dynamic-element>
6+ `
7+ } ;
Original file line number Diff line number Diff line change 1+ <script >
2+ export let tagName = ' dynamic-element'
3+ </script >
4+
5+ <svelte:element this ={tagName }>
6+ <header slot =' header' >header header header</header >
7+ </svelte:element >
You can’t perform that action at this time.
0 commit comments