-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add layout child sizing to Navigation block #47584
Conversation
Size Change: +24 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Flaky tests detected in cf49273. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4050871304
|
ce86ca7
to
cf49273
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working as intended! Thank you for adding this. While trying to recreate the design that @beafialho was aiming for with Fewer I fouwnd these extra margins on the navigation block that cannot be removed within the editor. We should try and address those in a separate PR:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for reviewing folks!
Those seem to be coming from here; @jasmussen might know more. |
What?
Allows adding custom sizes to Navigation block children, and fixes a bug in
hasChildLayoutSupport
that wasn't taking into account the possible shapes of the parent layout object.Note: this PR depends on #47477 in order to work correctly, because currently the Nav block edit function is passing the wrong layout config to its inner blocks.Edit: now that #47477 is merged and I've rebased this branch, this PR can be tested as-is.
Testing Instructions
Because of the dependency on #47477, is probably best to check out that branch and then apply this PR as a diff on top of it. Once it's built locally, you can:Note: for vertical Navs, the children will display a "Height" control, but in order for the "Fill" option to work the Nav block will need to have a fixed height value. Given the Nav block doesn't seem to have a min-height control available yet, the only way to do this is to stick the Nav inside a Row block with a sibling that is taller than itself, and set the Row vertical alignment (in the block toolbar) to "stretch".
Testing Instructions for Keyboard
Screenshots or screencast
Nav item with fixed size in px: