-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix navigation block placeholder preview markup #33963
Conversation
…en a vertical block is selected
Size Change: +87 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
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.
Does what it says on the tin ✅
display: none; | ||
} | ||
|
||
// Hide entirely when the placeholder can still be toggled. | ||
.wp-block-navigation.is-selected .is-small & { |
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.
When is this is-small
class added? Having display: none
on the placeholder when the block is selected, for either horizontal or vertical, doesn't seem to make any difference visually, so I must be missing something here 😅
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.
Thanks for reviewing. I can't see what this does either 🤔
Maybe it can be removed.
I'm just getting the kids ready for school, but I think the code was there to ensure varying heights of navigation styles were accommodated, not just the big ones from TT1. The way to test is to compare an empty menu with a filled out menu in height in Empty Theme. I'll take a look when I get a moment. |
Be mindful of optimizing for TwentyTwentyOne as it has a buggy custom implementation of nav block paddings and margins: https://core.trac.wordpress.org/ticket/53220 |
Gave it a shot, all's still working as it should. Thanks for the PR, thanks for the fix! On a separate note, code like what exists for this placeholder has shown its limitations, and has been taken as far as it can with 5.8. In light of #32373, I think there's an opportunity to revisit it and simplify it drastically, perhaps even as much as this: The idea being, the gray blobs are still perceived as a loading state, and patterns will likely need to step beyond the "start empty" state anyway, and actually insert menu items that are in a setup state instead. Such a refactor would also help untangle all the gray-blob-edgecases as evident by this PR. |
Description
Fixes two separate issues with the navigation block placeholder preview.
First, the preview has invalid html, nesting an
svg
element in aul
element:Secondly, when using a vertical navigation block, the invisible placeholder was taking up height, leading to this situation after selecting 'Start empty':
How has this been tested?
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).