@@ -418,24 +418,24 @@ const updateFallbackSlotVisibility = (elm: d.RenderNode) => {
418
418
childNode . hidden = false ;
419
419
420
420
for ( j = 0 ; j < ilen ; j ++ ) {
421
- if ( childNodes [ j ] [ 's-hn' ] !== childNode [ 's-hn' ] ) {
422
- // this sibling node is from a different component
423
- nodeType = childNodes [ j ] . nodeType ;
424
-
425
- if ( slotNameAttr !== '' ) {
426
- // this is a named fallback slot node
427
- if ( nodeType === NODE_TYPE . ElementNode && slotNameAttr === childNodes [ j ] . getAttribute ( 'slot' ) ) {
428
- childNode . hidden = true ;
429
- break ;
430
- }
431
- } else {
432
- // this is a default fallback slot node
433
- // any element or text node (with content)
434
- // should hide the default fallback slot node
435
- if ( nodeType === NODE_TYPE . ElementNode || ( nodeType === NODE_TYPE . TextNode && childNodes [ j ] . textContent . trim ( ) !== '' ) ) {
436
- childNode . hidden = true ;
437
- break ;
438
- }
421
+ nodeType = childNodes [ j ] . nodeType ;
422
+
423
+ if ( childNodes [ j ] [ 's-hn' ] !== childNode [ 's-hn' ] || slotNameAttr !== '' ) {
424
+ // this sibling node is from a different component OR is a named fallback slot node
425
+ if ( nodeType === NODE_TYPE . ElementNode && slotNameAttr === childNodes [ j ] . getAttribute ( 'slot' ) ) {
426
+ childNode . hidden = true ;
427
+ break ;
428
+ }
429
+ } else {
430
+ // this is a default fallback slot node
431
+ // any element or text node (with content)
432
+ // should hide the default fallback slot node
433
+ if (
434
+ nodeType === NODE_TYPE . ElementNode ||
435
+ ( nodeType === NODE_TYPE . TextNode && childNodes [ j ] . textContent . trim ( ) !== '' )
436
+ ) {
437
+ childNode . hidden = true ;
438
+ break ;
439
439
}
440
440
}
441
441
}
0 commit comments