Skip to content

fix(runtime): v5 non-shadow slot forwarding to better match native behaviour - #6814

Closed
johnjenkins wants to merge 4 commits into
mainfrom
fix-non-shadow-named-slot-forwarding
Closed

fix(runtime): v5 non-shadow slot forwarding to better match native behaviour#6814
johnjenkins wants to merge 4 commits into
mainfrom
fix-non-shadow-named-slot-forwarding

Conversation

@johnjenkins

@johnjenkins johnjenkins commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What is the current behavior?

GitHub Issue Number: #6770

What is the new behavior?

Fixes #6770

Tackling this issue raised lots of rough edges around non-shadow <slot> forwarding - all of which lead to unexpected / non-native behaviour.

slot forwarding logic revolved around corresponding name attributes.. i.e.

cmp-a > slot name=a
  cmp-b  > slot name=a

cmp-a's slot would try be forwarded to cmp-b's slot (and dynamically fail as per the linked issue).
This is incorrect - cmp-a's slot must also have a corresponding slot to forward.. otherwise it should go to the default slot, or be hidden if there is no default slot.

This PR roles in a number of small fixes to better align slot forwarding to the spec with 3 scenarios tested for:

  1. named slot forwarding to corresponding named slot
  2. named slot forwarding to default slot
  3. named slot having no slot to forward to and so hiding

This was tested for and fixed for initial hydration and dynamic insertion and removal

Tested against the linked repro

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Strictly not, but if users were relying on the broken behaviour then it could be perceived as breaking ... so I'm going to roll into v5

Testing

Other information

@johnjenkins
johnjenkins requested a review from a team as a code owner August 7, 2026 21:46
@johnjenkins johnjenkins changed the title fix(runtime): stop named forwarded slot being added to parent default slot fix(runtime): stop forwarded named slot being added to nested default slot Aug 7, 2026
@johnjenkins johnjenkins changed the title fix(runtime): stop forwarded named slot being added to nested default slot fix(runtime): non-shadow slot forwarding to better match native behaviour Aug 8, 2026
@johnjenkins johnjenkins changed the title fix(runtime): non-shadow slot forwarding to better match native behaviour fix(runtime): v5 non-shadow slot forwarding to better match native behaviour Aug 8, 2026
@johnjenkins
johnjenkins marked this pull request as draft August 8, 2026 01:17
@johnjenkins johnjenkins reopened this Aug 8, 2026
@johnjenkins johnjenkins closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: non-shadow component named slot forwarding puts content to default slot instead

1 participant