-
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
Zoom Out: Remove double click to exit hook from the block-editor package #66335
Zoom Out: Remove double click to exit hook from the block-editor package #66335
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: -34 B (0%) Total Size: 1.81 MB
ℹ️ View Unchanged
|
@@ -112,7 +111,6 @@ export function useBlockProps( props = {}, { __unstableIsHtml } = {} ) { | |||
useBlockRefProvider( clientId ), | |||
useFocusHandler( clientId ), | |||
useEventHandlers( { clientId, isSelected } ), | |||
useZoomOutModeExit(), |
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.
Good question, why was it added here? It's good to avoid adding hooks to every block if we can capture the event higher up.
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.
It was added here: #64573
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.
And the other one in the editor
package was added here more recently: #65963
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.
@andrewserong Any reason you left the other one in place?
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 ping! Nope, I left it there by accident as there were a couple of iterations on the approach. Thanks for following up!
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.
Works on my end, and yes agree it's an implementation detail.
…age (WordPress#66335) Co-authored-by: youknowriad <[email protected]> Co-authored-by: ellatrix <[email protected]>
Related #50739
What?
Ideally the zoom level of the block editor should be something that you can enforce from the settings of the editor. But to be able to do so, we need to move any "smart" behavior that exists zoom-out from the block-editor package.
Also, I noticed that the
useZoomOutModeExit
hook is applied into places (potentially duplicate). Do we know why it was applied on the block ref at all?This PR attempt to remove that duplication but I'm not entirely sure what impact it has. The goal being no impact at all.
Testing Instructions
1- Try double click to exit zoom out.