Block Visibility: remove stale toolbar icon when block is shown again#77238
Block Visibility: remove stale toolbar icon when block is shown again#77238Mustafabharmal wants to merge 1 commit intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
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. |
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I agree that the current behavior is inconsistent, but it is intentional to prevent focus loss. Please refer to this comment:
This PR will cause a focus loss with the following operations. Use only the keyboard for all operations.
- Insert a block.
- Hide the block.
- The visibility button appears in the block toolbar.
- Clicking the visibility button to open the "Hide blocks" modal.
- Change the block to a visible state.
- The visibility button in the block toolbar disappears, causing focus to be lost.
df886d3d2e7ceab38b0f20be1f472254.mp4
When a popover is closed, focus should generally return to the element that triggered it.
Let's discuss what the ideal behavior is before moving forward with this PR.
What?
Fixes a UI state bug where the Block Visibility icon in the block toolbar remained visible after visibility settings were cleared and the block became visible again.
Fixes #77237.
Why?
The issue reported that:
This creates inconsistent UI feedback and can confuse users about the actual visibility state.
How?
Testing Instructions
Screenshots or screencast
Before:
Before.hide.icon.fix.mov
After:
after.hide.icon.fix.mov