Skip to content

Fix hidden InnerBlocks.DefaultBlockAppender when block is deselected#78334

Open
BugReportOnWeb wants to merge 1 commit into
WordPress:trunkfrom
BugReportOnWeb:fix/default-block-appender-visibility
Open

Fix hidden InnerBlocks.DefaultBlockAppender when block is deselected#78334
BugReportOnWeb wants to merge 1 commit into
WordPress:trunkfrom
BugReportOnWeb:fix/default-block-appender-visibility

Conversation

@BugReportOnWeb
Copy link
Copy Markdown
Contributor

What?

Closes #74060

Fixes a bug where using renderAppender={ InnerBlocks.DefaultBlockAppender } on a block causes the appender to be hidden and a empty dashed outline to appear when the block is deselected.

Why?

When a block author explicitly passes renderAppender={ InnerBlocks.DefaultBlockAppender } to InnerBlocks, the expectation is that the “Type / to choose a block” placeholder remains visible even when the block is not selected.

However, .block-editor-default-block-appender was previously hidden whenever its parent block was neither selected nor has a selected child, without accounting for cases where the default appender had been explicitly forced via renderAppender. As a result, the appender disappeared when the block was deselected.

How?

  • In block-list/index.js, detect when CustomAppender is explicitly DefaultBlockAppender and pass an isDefaultAppender flag to BlockListAppender.
  • In block-list-appender/index.js, convert that flag into an is-default-appender class on the appender wrapper element, providing a reliable CSS hook.
  • In block-list/content.scss, scope the existing hiding rule so it excludes appenders explicitly rendered via renderAppender using .block-list-appender:not(.is-default-appender).

Testing Instructions

  1. Open a post or page in the block editor.
  2. Temporarily modify packages/block-library/src/group/edit.js (line 102) as following:
        } else if ( ! hasInnerBlocks ) {
                // When there is no placeholder, but the block is also empty,
                // use the larger button appender.
-               renderAppender = InnerBlocks.ButtonBlockAppender;
+               renderAppender = InnerBlocks.DefaultBlockAppender;
        }
  1. Insert a Group block and select an option on the placeholder.
  2. Click away to deselect the block.
  3. Expected: The "Type / to choose a block" placeholder is visible.
  4. Before this fix: The appender is hidden and a dashed outline appears.

Screenshots or screencast

State Before After
Selected Screenshot 2026-05-15 at 4 06 11 PM Screenshot 2026-05-15 at 4 06 53 PM
Unselected Screenshot 2026-05-15 at 4 06 28 PM Screenshot 2026-05-15 at 4 07 08 PM

Use of AI Tools

  • ChatGPT for rephrasing and refining the PR description.
  • GitHub Copilot for implementation-related assistance.

@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label May 15, 2026
@BugReportOnWeb BugReportOnWeb marked this pull request as ready for review May 15, 2026 11:47
@BugReportOnWeb BugReportOnWeb requested a review from ellatrix as a code owner May 15, 2026 11:47
@github-actions
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: BugReportOnWeb <devasheeshkaul@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Feature] Inserter The main way to insert blocks using the + button in the editing interface labels May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using InnerBlocks.DefaultBlockAppender for renderAppender is visually broken when the block is deselected

2 participants