Skip to content

[6.x] Draw a slotted secondary-nav action inside the menu - #19883

Closed
brianjhanson wants to merge 1 commit into
6.xfrom
fix/subnav-slotted-actions
Closed

brianjhanson wants to merge 1 commit into
6.xfrom
fix/subnav-slotted-actions

Conversation

@brianjhanson

Copy link
Copy Markdown
Contributor

A secondary nav whose actions come from the actions slot rather than the actions prop now draws a menu, and draws the slotted action inside it.

Two things stood in the way:

SecondaryNav gated the menu on actions.length, so filling only the slot produced no menu at all and the slotted content never rendered. The guard now also counts the slot.

Above the large breakpoint the slot rendered beside ActionMenu rather than inside it, so a slotted action sat loose next to the menu button instead of joining the items under it. ActionMenu gained an actions slot of its own, appended after its rendered list, and the nav passes its slot through to it. The collapsed presentation already did this — its slot sits inside the menu's content — so the two now agree.

Verification

A nav given only prop actions is unchanged, in both presentations. One given only a slotted action now shows the menu, with the action inside it. SecondaryNav's tests pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NjeigCjRgjTJpnhbvyrxv8

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

@brianjhanson

Copy link
Copy Markdown
Contributor Author

Rolled into #19884 — ActionMenu.vue and SecondaryNav.vue there are byte-identical to this branch, since the bridged element index needs the slotted action to land inside the menu.

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.

1 participant