-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Block Tools: Prevent showing block toolbar when block interface is hidden #69795
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
stokesman
left a comment
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 the fix! As a nitpick, ! isBlockInterfaceHidden() could be first in the list of conditions so when it evaluates to false it short-circuits the rest of them.
I agree with restoring this functionality because it does seem to have been unintentionally removed. That said, after testing, I do find it can feel a little distracting or mysterious in some cases. I guess mainly when there are no padding values to visualize but the block toolbar hides anyway. This and a few other details are covered in #45503 but I’m not suggesting we pursue any of that in this PR.
0ac6ba2 to
f258d24
Compare
|
Thanks for the review, @stokesman! I've implemented the suggested changes. As a follow-up to this PR, I'd like to work on the enhancements outlined in #45503. |
|
Thanks for working on this, @yogeshbhutkar! |
…dden (WordPress#69795) Co-authored-by: yogeshbhutkar <[email protected]> Co-authored-by: stokesman <[email protected]> Co-authored-by: Mamaduka <[email protected]> Co-authored-by: Mayank-Tripathi32 <[email protected]>
What?
Closes #68711
This PR fixes a regression, likely introduced in #56914, that restores the visualizer's behavior of hiding the
Block Toolbarwhen theBlock Interfaceis hidden.Why?
An additional
isBlockInterfaceHidden()check seems to have been omitted here:gutenberg/packages/block-editor/src/components/block-tools/use-show-block-tools.js
Line 48 in 4ac0ade
How?
A check for
! isBlockInterfaceHidden()was added while determining_showBlockToolbarPopover.Additional Context
If we choose not to fix this regression, we should at least clean up the following unused code:
hideBlockInterfaceandshowBlockInterface, but this serves no purpose sinceisBlockInterfaceHidden()is currently unused.gutenberg/packages/block-editor/src/hooks/dimensions.js
Lines 34 to 35 in 4ac0ade
Testing Instructions
Block Toolbarhides when changing margins.Testing Instructions for Keyboard
Same.
Screencast