-
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
Block Editor: Avoid rendering empty Slot for block alignments #55689
Conversation
@jsnajdr, we need to try a different approach to reduce store subscription numbers for this control. Maybe something like #55345. However, I need to double-check if Update: Here's the draft PR #55692. |
Size Change: +6 B (0%) Total Size: 1.7 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.
Looks good, thank you!
Thanks for testing, Nik! |
Oops, thanks for fixing the regression I introduced 😨 |
What?
Fixes #55687.
A regression was introduced in #55449.
PR restores the
useAvailableAlignments
call in thewithToolbarControls
HoC to avoid rendering an empty block toolbars slot.P.S. A similar optimization was attempted in #34593 but later was restored via #35822 for similar reasons.
Why?
There's a mismatch between values returned by
getValidAlignments
anduseAvailableAlignments
. The latter takes alignments available for the given layout, which will be none for the root-level blocks in the site editor (#30079).Testing Instructions
Screenshots or screencast