WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.54k stars 4.21k forks source link

Zoom out returns after inserter is closed #66328

Open draganescu opened 1 month ago

draganescu commented 1 month ago

Description

Disabling zoom out while the inserter is open makes it come back when the inserter is closed.

Step-by-step reproduction instructions

https://github.com/user-attachments/assets/0efcb333-6eab-40e8-92e4-91c436535660

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Please confirm which theme type you used for testing.

draganescu commented 1 month ago

This is because of the useZoomOut hook "toggling" the state instead of setting it.

Mamaduka commented 1 month ago

I also noticed that the useZoomOut hook is public and shipped with WP 6.6. It should've been a private hook.

jeryj commented 1 month ago

I also noticed that the useZoomOut hook is public and shipped with WP 6.6. It should've been a private hook.

Yup -- that is true.

@draganescu - @ajlende and I are testing this and unable to reproduce on the 6.7 branch. Can you try again on 6.7?

jeryj commented 1 month ago

Confirmed this a bug on trunk, not on wp/6.7. I remove it from the wp/6.7 board and removed the high priority tag.

Mamaduka commented 1 month ago

There might still be time to make useZoomOut private and remove public references. I doubt anyone is using this hook outside of the plugin/core.

draganescu commented 1 month ago

I triple vote this. Then maybe we can delete it.

jeryj commented 1 month ago

Made it private in this PR: https://github.com/WordPress/gutenberg/pull/66374

Mamaduka commented 1 week ago

Encountered and got reminded of this bug again today. Here's my alternative approach - #67033.