Repository navigation
[6.x] Draw a slotted secondary-nav action inside the menu - #19883
Closed
brianjhanson wants to merge 1 commit into
Closed
brianjhanson wants to merge 1 commit into
brianjhanson wants to merge 1 commit into
Conversation
📚 Storybook previews@craftcms/ui — open Storybook No changed components detected in this Storybook. resources/js — open Storybook No changed components detected in this Storybook. |
Contributor
Author
|
Rolled into #19884 — |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A secondary nav whose actions come from the
actionsslot rather than theactionsprop now draws a menu, and draws the slotted action inside it.Two things stood in the way:
SecondaryNavgated the menu onactions.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
ActionMenurather than inside it, so a slotted action sat loose next to the menu button instead of joining the items under it.ActionMenugained anactionsslot 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