Skip to content

Zoom out: Pattern inserter always forces iframe editor #66671

@t-hamano

Description

@t-hamano

Description

When the Patterns tab is selected, the zoom out mode is enabled via the useZoomOut hook and the editor behaves as an iframe. On the other hand, if the editor is NOT an iframe, the zoom out toggle is not displayed (#65452).

This inconsistency leads to unintended behavior.

Step-by-step reproduction instructions

To make the useShouldIframe hook return false, do the following:

  • Activate the classic theme.
  • Activate a plugin that includes the v2 block (e.g. CoBlocks).

  • Open the post editor.
  • The editor should be running as a non-iframe.
  • Enable custom fields and refresh your browser. Ensure the meta box is legacy (not resizable).
  • Select the Patterns tab from the main inserter.
    • 🤔 You should see the zoom out toggle button in the header.
    • 🤔 The meta box should change to resizable.
  • Click the zoom out toggle button in the header.
    • 🤔 The zoom out button should disappear.
    • 🤔 The meta box should change to legacy.

What is your proposed solution?

Here are my suggested approach for the non-iframe editor:

  • For WP 6.7: Don't enable zoom out mode when accessing the Patterns tab.
  • For Gutenberg (WP 6.8): Enable zoom out mode in the non-iframe editor, i.e. displays the zoom out toggle button in the header and also provides the zoom out shortcut.

Screenshots, screen recording, code snippet

51bac6ccd36c6912d649d252502c93ea.mp4

Environment info

No response

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

  • Yes

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

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions