Skip to content
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

6.7 & v2 of blockApi pushes metaboxes very far away from content #66879

Closed
4 of 6 tasks
MadtownLems opened this issue Nov 8, 2024 · 3 comments · Fixed by #66706
Closed
4 of 6 tasks

6.7 & v2 of blockApi pushes metaboxes very far away from content #66879

MadtownLems opened this issue Nov 8, 2024 · 3 comments · Fixed by #66706
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended

Comments

@MadtownLems
Copy link

Description

I'm testing 6.7-RC-3, and noticed that when you still have blocks using v2 of the blockApi, that any metaboxes below the content editor are pushed very far away from the bottom of your content (so far that I'm concerned people won't even see them).

Step-by-step reproduction instructions

  1. Have a block registered with v2 of the block API
  2. Have a plugin that adds a metabox below the content
  3. Notice how the gap between content and the metabox is huge (starting only with 6.7)

Screenshots, screen recording, code snippet

Image

Environment info

WP 6.7-RC-3, no Gutenberg plugin.
Theme: Twentytwentyfive (and others)
Windows 10

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
@MadtownLems MadtownLems added the [Type] Bug An existing feature does not function as intended label Nov 8, 2024
@t-hamano t-hamano added the [Feature] Meta Boxes A draggable box shown on the post editing screen label Nov 9, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Nov 9, 2024

Thanks for the report.

Strictly speaking, this 40vh space between the content and the meta box was also present in 6.6.2 (See #64639).

Also, if a block using apiVersion 2 is present, the editor works as a non-iframe. And the meta box is not resizable. #66706 aims to enable resizable meta boxes in the non-iframe editor. I think that if this PR is shipped, it will also resolve the issues raised here.

cc @stokesman @talldan

@MadtownLems
Copy link
Author

Strictly speaking, this 40vh space between the content and the meta box was also present in 6.6.2

Ah yes, I stand corrected. We didn't notice it there because we had some custom CSS impacting the height of the editor. That CSS was breaking things in 6.7, and when removing it, I noticed this larger gap.

I do like the resizable metabox approach, but it seems that's a ways off. Any chance of getting this height reduced in the meantime? As I mentioned, that gap is SO large that it's super easy for people to miss that metaboxes are even down there. And some contain very important - or even required - fields.

Attached is a screenshot of the editor. There are metaboxes off the screen because the gap is so big. 😮

Image

@stokesman
Copy link
Contributor

Any chance of getting this height reduced in the meantime?

I take it you mean in the Gutenberg plugin? In WP the next chance would be 6.7.1 and I hope that we include #66706 there. In the meantime I suppose the plugin could add a condition for the combination of meta boxes and legacy canvas that reduces the height. Then you’d have to be using the plugin on any concerned sites.

Overriding the style seems simple enough. This snippet works from my quick testing:

function example_enqueue_editor_content_assets() {
	// Used to avoid duplicating the added style since the hook is invoked twice.
	static $is_added = false;
	if ( ! $is_added && is_admin() ) {
		$is_added = true;
		wp_add_inline_style(
			'wp-editor-classic-layout-styles',
			'.has-metaboxes .editor-visual-editor:not(.is-iframed) .editor-styles-wrapper::after{ height: 4em }'
		);
	}
}
add_action( 'enqueue_block_assets', 'example_enqueue_editor_content_assets' );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Meta Boxes A draggable box shown on the post editing screen [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants