File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ class WebComponent extends HTMLElement {
170
170
} else {
171
171
this . _state [ slot ] = child ;
172
172
}
173
- child . setAttribute ( "slot" , slotName ) ;
174
173
} ) ;
175
174
}
176
175
@@ -382,12 +381,22 @@ class WebComponent extends HTMLElement {
382
381
delete this . _invalidated ;
383
382
ControlRenderer . render ( this ) ;
384
383
384
+ // Safari requires that children get the slot attribute only after the slot tags have been rendered in the shadow DOM
385
+ this . _assignSlotsToChildren ( ) ;
386
+
385
387
// onAfterRendering
386
388
if ( typeof this . onAfterRendering === "function" ) {
387
389
this . onAfterRendering ( ) ;
388
390
}
389
391
}
390
392
393
+ _assignSlotsToChildren ( ) {
394
+ const domChildren = Array . from ( this . children ) ;
395
+ domChildren . filter ( child => child . _slot ) . forEach ( child => {
396
+ child . setAttribute ( "slot" , child . _slot ) ;
397
+ } ) ;
398
+ }
399
+
391
400
_getTemplateContext ( ) {
392
401
return TemplateContext . calculate ( this ) ;
393
402
}
You can’t perform that action at this time.
0 commit comments