Skip to content

Fix post editor: Meta boxes become invisible in Code Editor view#78644

Open
Mustafabharmal wants to merge 2 commits into
WordPress:trunkfrom
Mustafabharmal:fix/78637-code-editor-metaboxes-split-view
Open

Fix post editor: Meta boxes become invisible in Code Editor view#78644
Mustafabharmal wants to merge 2 commits into
WordPress:trunkfrom
Mustafabharmal:fix/78637-code-editor-metaboxes-split-view

Conversation

@Mustafabharmal

Copy link
Copy Markdown
Contributor

What?

In Code Editor (text) mode, meta boxes at the bottom of the post editor become invisible and unreachable once the content field grows taller than the viewport. This is a regression since WP 7.0.

Closes #78637

Why?

The split-view meta boxes layout (introduced in #69958) applies flex constraints to .editor-visual-editor to keep it from pushing the meta box panel out of view. No equivalent rule existed for .editor-text-editor.

When the react-autosize-textarea grows with content, the text editor expands beyond the viewport, pushing MetaBoxesMain outside the scrollable area and making it unreachable.

How?

  • Add a single SCSS parent rule targeting the split‑view context and apply shared sizing to both editors, then set per‑editor overflow:
    • .editor-visual-editor: overflow: hidden (existing behavior).
    • .editor-text-editor: overflow: auto (keeps code area scrollable while meta boxes remain docked).

Testing Instructions

  1. Open a post/page for editing.
  2. Activate a plugin that registers meta boxes (e.g. any plugin with add_meta_box()).
  3. Switch to Code Editor view (⋮ → Code editor).
  4. Paste/type enough content that the textarea grows taller than the viewport.
  5. Expected: Meta box panel remains visible and docked at the bottom; code area scrolls internally.
  6. Previously: Meta box panel disappeared below the viewport and could not be scrolled to.
Sample Filter for meta box
add_action( 'add_meta_boxes', function() {
    add_meta_box(
        'test_meta_normal',
        'Test Meta (Normal)',
        function( $post ) {
            echo '<label>Custom Field 1: <input type="text" name="test_field_1" value="' 
                . esc_attr( get_post_meta( $post->ID, 'test_field_1', true ) ) . '"></label><br><br>';
            echo '<label>Custom Field 2: <input type="text" name="test_field_2" value="' 
                . esc_attr( get_post_meta( $post->ID, 'test_field_2', true ) ) . '"></label>';
        },
        [ 'post', 'page' ],
        'normal'
    );
    add_meta_box(
        'test_meta_advanced',
        'Test Meta (Advanced)',
        function( $post ) {
            echo '<label>SEO Title: <input type="text" name="seo_title" value="' 
                . esc_attr( get_post_meta( $post->ID, 'seo_title', true ) ) . '"></label><br><br>';
            echo '<label>SEO Description: <textarea name="seo_desc" rows="3" style="width:100%">' 
                . esc_textarea( get_post_meta( $post->ID, 'seo_desc', true ) ) . '</textarea></label>';
        },
        [ 'post', 'page' ],
        'advanced'
    );
} );

Screenshots or screencast

Before After
image image

@github-actions

github-actions Bot commented May 25, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mustafabharmal <mustafabharmal@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: remcokalf <rembem@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the [Package] Edit Post /packages/edit-post label May 25, 2026
@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Meta Boxes A draggable box shown on the post editing screen labels May 26, 2026
@aaronjorbin aaronjorbin moved this from 🔎 Needs Review to ❓ Triage in WordPress 7.0 Editor Tasks May 26, 2026
@github-project-automation github-project-automation Bot moved this to 🔎 Needs Review in WordPress 7.0 Editor Tasks May 26, 2026
@t-hamano t-hamano moved this from ❓ Triage to 🔎 Needs Review in WordPress 7.0 Editor Tasks May 28, 2026
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 [Package] Edit Post /packages/edit-post [Type] Bug An existing feature does not function as intended

Projects

Status: 🔎 Needs Review

Development

Successfully merging this pull request may close these issues.

Meta boxes become invisible or unreachable in Code Editor view when editing posts

4 participants