Zoom Out: Disable zoom out toggle button when Style Book is open#66228
Zoom Out: Disable zoom out toggle button when Style Book is open#66228
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. |
|
Size Change: +11 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
madhusudhand
left a comment
There was a problem hiding this comment.
It works well in my testing.
- Zoom-out is disabled (in its current state, normal and active)
- Zoom-out mode is restored when style book is off.
- It also works the same with revisions.
- Button is still accessible and screen reader announces it as dimmed.
getdave
left a comment
There was a problem hiding this comment.
Thank you for this 👍
This is "good enough" for me. It's an edge case anyway but it's nice to help users to avoid getting into awkward states.
| accessibleWhenDisabled | ||
| disabled={ disabled } |
There was a problem hiding this comment.
TIL about this new prop.
Interesting that we don't just set accessibleWhenDisabled to true by default. I assume there's some logical reason why that's not the case.
There was a problem hiding this comment.
Yeah, I only learned about it thanks to the linter! As far as I can tell it's optional in Ariakit (https://ariakit.org/reference/button#accessiblewhendisabled), so I imagine our Button component has it optional either for consistency or back compat. I agree it feels a bit redundant, though, having to set it in a bunch of places as in Gutenberg I imagine we'd want to be using it all the time.
Good to keep in mind for future consolidation, for sure 👍
|
There was a conflict while trying to cherry-pick the commit to the wp/6.7 branch. Please resolve the conflict manually and create a PR to the wp/6.7 branch. PRs to wp/6.7 are similar to PRs to trunk, but you should base your PR on the wp/6.7 branch instead of trunk. |
) Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: madhusudhand <madhudollu@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org> # Conflicts: # packages/editor/src/components/header/index.js
|
Manual backport here #66233. |
) (#66233) Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: madhusudhand <madhudollu@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org> # Conflicts: # packages/editor/src/components/header/index.js Co-authored-by: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: ajlende <ajlende@git.wordpress.org>
|
Thanks folks! |
…dPress#66228) Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: madhusudhand <madhudollu@git.wordpress.org> Co-authored-by: getdave <get_dave@git.wordpress.org> Co-authored-by: colorful-tones <colorful-tones@git.wordpress.org>
What?
Fixes #66127
Try disabling the Zoom Out Toggle button in the header when the Style Book is open
Why?
Clicking the button doesn't really do anything, so similar to what happens with the block inserter, try disabling the toggle button when the style book is open.
How?
Borrow the same approach as used for disabling block controls.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
2024-10-18.17.25.14.mp4