Skip to content

Quote: Ensure paragraph placeholder appears after deleting nested blocks - #77151

Merged
ellatrix merged 7 commits into
WordPress:trunkfrom
dpmehta:fix/quote-block-inner-blocks-deletion
Jul 30, 2026
Merged

Quote: Ensure paragraph placeholder appears after deleting nested blocks#77151
ellatrix merged 7 commits into
WordPress:trunkfrom
dpmehta:fix/quote-block-inner-blocks-deletion

Conversation

@dpmehta

@dpmehta dpmehta commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

What?

Closes #59709

This PR updates the Quote block to conditionally show the default appender only when the block is empty, ensuring that deleting nested block correctly reverts the Quote block to its initial state with a paragraph placeholder.

Why?

Previously Quote block had its appender strictly disabled renderAppender: false. Because of this, when we delete the last inner-block (e.g list block) by pressing backspace, the block becomes completely empty. Since there was no appender available, the Gutenberg editor could not display prompt ( like a placeholder paragraph block ) which forces the editor selection logic to fall entirely out of the main editing area and into the only remaining interactable field that is citation text field.

How?

This PR updates code to evaluate whether the block is completely empty using useSelect to read innerBlocks.length:

  • We now fetch hasInnerBlocks.

  • Instead of strictly hardcoding renderAppender: false, it's now updated to renderAppender: hasInnerBlocks ? false : undefined.

  • Now, when the block has nested inner blocks, the appender stays hidden (maintaining previous behavior expectations). However, if you delete the nested block (i.e. the List), hasInnerBlocks becomes false, Gutenberg shows the undefined default block appender natively, and hitting Backspace safely turns that empty state into a default selected Paragraph context

Testing Instructions

  1. Open any demo or testing Post.
  2. Add Quote block into that Post.
  3. Add list blocks inside Quote block and add one item into list block.
  4. Now using backspace remove list item and list block.
  5. Observe now Quote block shows Placeholder and appender by which nested (Inner) block can be added.

Screenshots or screencast

Before

quote-block-inserter-before.mov

After

quote-block-inserter-after.mov
Before After
Screenshot 2026-04-08 at 6 58 18 PM Screenshot 2026-04-08 at 6 56 33 PM

Use of AI Tools

Used Gemini 3.1 Pro for code analysis and testing purpose and drafting PR text. All logic changes were manually reviewed and validated in a local environment.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 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: dpmehta <mehtadev@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@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 First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 8, 2026
@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @dpmehta! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

const { getBlock } = select( blockEditorStore );
const block = getBlock( clientId );
return {
hasInnerBlocks: !! ( block && block.innerBlocks.length ),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hasInnerBlocks: !! ( block && block.innerBlocks.length ),
hasInnerBlocks: getBlockCount( clientId ) > 0,

We could use something like this here, make similar assertions easier, IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your valuable feedback ! i have made changes and made assertions easier

@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Quote Affects the Quote Block labels Apr 8, 2026
@dpmehta
dpmehta requested a review from Mamaduka April 9, 2026 11:20
@Mamaduka

Copy link
Copy Markdown
Member

Thanks for the update, @dpmehta!

It looks like the appender was removed in #60307. Given this change, it might be better to fully reintroduce it and avoid adding extra logic to the block. cc @jasmussen

Since the default appender looks like a paragraph, it might seem that nothing happened after removal. Maybe a button appender is better suited for these cases, but it depends on how we handle the first question.

Screencast

CleanShot.2026-04-14.at.12.01.52.mp4

@dpmehta

dpmehta commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@Mamaduka Thanks for the reply, what should be the next step , we should wait for the suggestion right regarding reintroducing the appender ?

@Mamaduka

Copy link
Copy Markdown
Member

Let’s wait for additional feedback for now.

@jasmussen

Copy link
Copy Markdown
Contributor

Thanks for the ping. Good instincts all around.

Context on the previous removal of the appender was to ensure there wasn't a layout shift. If this PR doesn't introduce a layout shift, then that's not a part of the problem.

One thing that makes this tricky is whether to write bespoke logic for individual blocks, or whether there's a generic solution that works across any nested block. I.e. how is a quote block different from a group block, except semantically and visually? Both are really just boxes.

At the same time, I'd tend to think that as Markdown is radically expanding on the web, I'd really like to be able to write as if I was in a visual markdown editor. Like this:

markdown test

For me, that's really the writing flow to consider. Basic typing in one direction, and consistent backspacing in the reverse direction. IMO there is a way to approach this at the writing flow level, so ideally we can have generic rules across container blocks. Embedded here are some technical questions however, which I'll defer to those with stronger skill than my own, and that could entail that some container blocks always start and end with a paragraph block, and can't exist without it. (List comes to mind here as well)

@ellatrix

ellatrix commented Jul 30, 2026

Copy link
Copy Markdown
Member

I think this is a fine temporary fix. I doesn't fix the issue completely, but at least it doesn't leave the block completely empty. I think in 7.2 we should attempt something like ensureDefaultBlock not just for the editor root, but also any block that uses the "default" (paragraph) appender for its inner blocks.

ellatrix and others added 4 commits July 29, 2026 19:57
…r-blocks-deletion

# Conflicts:
#	packages/block-library/src/quote/edit.js
@ellatrix
ellatrix self-requested a review as a code owner July 30, 2026 03:20
@github-actions github-actions Bot added the [Package] Block editor /packages/block-editor label Jul 30, 2026
@ellatrix
ellatrix enabled auto-merge (squash) July 30, 2026 20:15
@ellatrix ellatrix added the Backport to WP 7.1 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jul 30, 2026
@ellatrix
ellatrix merged commit 9376767 into WordPress:trunk Jul 30, 2026
46 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.8 milestone Jul 30, 2026
@github-actions github-actions Bot removed the Backport to WP 7.1 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Jul 30, 2026
gutenbergplugin pushed a commit that referenced this pull request Jul 30, 2026
…cks (#77151)

Co-authored-by: dpmehta <mehtadev@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
@github-actions github-actions Bot added the Backported to WP Core Pull request that has been successfully merged into WP Core label Jul 30, 2026
@github-actions

Copy link
Copy Markdown

I just cherry-picked this PR to the wp/7.1 branch to get it included in the next release: dfa4a0f

pento pushed a commit to WordPress/wordpress-develop that referenced this pull request Aug 5, 2026
This updates the pinned commit hash of the Gutenberg repository from `fd715a6833679d098d9fee84b642f8f1bc27341b` to `f05e40e91c54f29c449b1f33d0db89f5166812d9`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@fd715a6...f05e40e

- Writing flow: forward delete an empty paragraph without breaking apart the next block (WordPress/gutenberg#80813)
- Upload Media: Fail the item when the /finalize request fails (WordPress/gutenberg#80725)
- Fix template `modified` and `date` return value for file templates (WordPress/gutenberg#80733)
- Boot: Adjust specificity of the image reset styles so components can size their own images (WordPress/gutenberg#80845)
- Quote: Ensure paragraph placeholder appears after deleting nested blocks (WordPress/gutenberg#77151)
- Block editor: make the Group action wrap blocks with a group transform (WordPress/gutenberg#80891)
- Copy: preserve the block when its entire text is selected (WordPress/gutenberg#80994)
- Add opt-out for block style state controls (WordPress/gutenberg#80956) (WordPress/gutenberg#81004)
- Tabs: Support Home and End keys for keyboard navigation (WordPress/gutenberg#80912)
- Rename blockStatesEnabled setting to blockStatesEditingEnabled (WordPress/gutenberg#81058)
- [WP 7.1] Background: Fix the legacy gradient UI where a gradient cannot be selected (WordPress/gutenberg#81059)
- Views: honor developer-defined view config overrides (WordPress/gutenberg#80832)
- Playlist: Add track icon (WordPress/gutenberg#81078)
- Remove the CODEOWNERS file from wp/7.1. (WordPress/gutenberg#81104)
- Notes: Email users mentioned in a note (WordPress/gutenberg#79606)
- Backport 81068 80744 80642 (WordPress/gutenberg#81135)
- Site Editor: Add E2E coverage for view config extensibility (WordPress/gutenberg#80577)
- change from WordPress/gutenberg#81068 (WordPress/gutenberg#81140)
- Link Control: Restore the preview title underline (WordPress/gutenberg#81083)
- Button: Suppress UA focus ring when focused and pressed (WordPress/gutenberg#81113)
- View config: add reference docs (WordPress/gutenberg#81149)
- Editor: Fix document tools button focus ring (WordPress/gutenberg#81115)
- Interface: Increase footer breadcrumb height to prevent focus ring clipping (WordPress/gutenberg#81156)
- Post editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81112)
- Pass Playlist controls to track blocks (WordPress/gutenberg#81158)
- Theme: Omit color properties when neither provided nor inherited (WordPress/gutenberg#80600) (WordPress/gutenberg#81172)
- Media: Improve the HEIC upload error and keep any upload errors up until dismissed (WordPress/gutenberg#81130)
- Video: Hide settings for the GIF variation (WordPress/gutenberg#81142)
- Video: clarify the Video variation description (WordPress/gutenberg#81181)
- Button: turn on the width setting by default in theme.json (WordPress/gutenberg#81196)
- Edit Widgets: Fix header toolbar button focus ring (WordPress/gutenberg#81176)
- Build: Wrap script bundles in an IIFE to contain 'use strict' (WordPress/gutenberg#79792)
- Customizer widgets: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81174)
- Fix: Tabs block: Start with empty tab labels with placeholders (WordPress/gutenberg#81197)
- PanelColorSettings: Restore the missing space below the panel header (WordPress/gutenberg#81155)
- Visual revisions: add shareable urls (WordPress/gutenberg#81205)
- Notes: fix the mention notification email composition (WordPress/gutenberg#81187)
- Fix ESLint warnings for 'navigateRegionsProps' spread (WordPress/gutenberg#81208)
- Widgets editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81173)
- Remove the editableRoot opt-in from the paragraph block (WordPress/gutenberg#81184)
- Media Attached to: Fix issue with the popover unexpectedly flipping, tweak wording (WordPress/gutenberg#81206)
- Ensure device preview is always accurate when window is zoomed in (WordPress/gutenberg#81215)

Props wildworks.
See #65529.

git-svn-id: https://develop.svn.wordpress.org/trunk@63026 602fd350-edb4-49c9-b593-d223f7449a82
markjaquith pushed a commit to markjaquith/WordPress that referenced this pull request Aug 5, 2026
This updates the pinned commit hash of the Gutenberg repository from `fd715a6833679d098d9fee84b642f8f1bc27341b` to `f05e40e91c54f29c449b1f33d0db89f5166812d9`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@fd715a6...f05e40e

- Writing flow: forward delete an empty paragraph without breaking apart the next block (WordPress/gutenberg#80813)
- Upload Media: Fail the item when the /finalize request fails (WordPress/gutenberg#80725)
- Fix template `modified` and `date` return value for file templates (WordPress/gutenberg#80733)
- Boot: Adjust specificity of the image reset styles so components can size their own images (WordPress/gutenberg#80845)
- Quote: Ensure paragraph placeholder appears after deleting nested blocks (WordPress/gutenberg#77151)
- Block editor: make the Group action wrap blocks with a group transform (WordPress/gutenberg#80891)
- Copy: preserve the block when its entire text is selected (WordPress/gutenberg#80994)
- Add opt-out for block style state controls (WordPress/gutenberg#80956) (WordPress/gutenberg#81004)
- Tabs: Support Home and End keys for keyboard navigation (WordPress/gutenberg#80912)
- Rename blockStatesEnabled setting to blockStatesEditingEnabled (WordPress/gutenberg#81058)
- [WP 7.1] Background: Fix the legacy gradient UI where a gradient cannot be selected (WordPress/gutenberg#81059)
- Views: honor developer-defined view config overrides (WordPress/gutenberg#80832)
- Playlist: Add track icon (WordPress/gutenberg#81078)
- Remove the CODEOWNERS file from wp/7.1. (WordPress/gutenberg#81104)
- Notes: Email users mentioned in a note (WordPress/gutenberg#79606)
- Backport 81068 80744 80642 (WordPress/gutenberg#81135)
- Site Editor: Add E2E coverage for view config extensibility (WordPress/gutenberg#80577)
- change from WordPress/gutenberg#81068 (WordPress/gutenberg#81140)
- Link Control: Restore the preview title underline (WordPress/gutenberg#81083)
- Button: Suppress UA focus ring when focused and pressed (WordPress/gutenberg#81113)
- View config: add reference docs (WordPress/gutenberg#81149)
- Editor: Fix document tools button focus ring (WordPress/gutenberg#81115)
- Interface: Increase footer breadcrumb height to prevent focus ring clipping (WordPress/gutenberg#81156)
- Post editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81112)
- Pass Playlist controls to track blocks (WordPress/gutenberg#81158)
- Theme: Omit color properties when neither provided nor inherited (WordPress/gutenberg#80600) (WordPress/gutenberg#81172)
- Media: Improve the HEIC upload error and keep any upload errors up until dismissed (WordPress/gutenberg#81130)
- Video: Hide settings for the GIF variation (WordPress/gutenberg#81142)
- Video: clarify the Video variation description (WordPress/gutenberg#81181)
- Button: turn on the width setting by default in theme.json (WordPress/gutenberg#81196)
- Edit Widgets: Fix header toolbar button focus ring (WordPress/gutenberg#81176)
- Build: Wrap script bundles in an IIFE to contain 'use strict' (WordPress/gutenberg#79792)
- Customizer widgets: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81174)
- Fix: Tabs block: Start with empty tab labels with placeholders (WordPress/gutenberg#81197)
- PanelColorSettings: Restore the missing space below the panel header (WordPress/gutenberg#81155)
- Visual revisions: add shareable urls (WordPress/gutenberg#81205)
- Notes: fix the mention notification email composition (WordPress/gutenberg#81187)
- Fix ESLint warnings for 'navigateRegionsProps' spread (WordPress/gutenberg#81208)
- Widgets editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81173)
- Remove the editableRoot opt-in from the paragraph block (WordPress/gutenberg#81184)
- Media Attached to: Fix issue with the popover unexpectedly flipping, tweak wording (WordPress/gutenberg#81206)
- Ensure device preview is always accurate when window is zoomed in (WordPress/gutenberg#81215)

Props wildworks.
See #65529.
Built from https://develop.svn.wordpress.org/trunk@63026


git-svn-id: http://core.svn.wordpress.org/trunk@62245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
DanielHudson2 pushed a commit to DanielHudson2/wordpress-develop that referenced this pull request Aug 10, 2026
This updates the pinned commit hash of the Gutenberg repository from `fd715a6833679d098d9fee84b642f8f1bc27341b` to `f05e40e91c54f29c449b1f33d0db89f5166812d9`.

A full list of changes included in this commit can be found on GitHub: 
WordPress/gutenberg@fd715a6...f05e40e

- Writing flow: forward delete an empty paragraph without breaking apart the next block (WordPress/gutenberg#80813)
- Upload Media: Fail the item when the /finalize request fails (WordPress/gutenberg#80725)
- Fix template `modified` and `date` return value for file templates (WordPress/gutenberg#80733)
- Boot: Adjust specificity of the image reset styles so components can size their own images (WordPress/gutenberg#80845)
- Quote: Ensure paragraph placeholder appears after deleting nested blocks (WordPress/gutenberg#77151)
- Block editor: make the Group action wrap blocks with a group transform (WordPress/gutenberg#80891)
- Copy: preserve the block when its entire text is selected (WordPress/gutenberg#80994)
- Add opt-out for block style state controls (WordPress/gutenberg#80956) (WordPress/gutenberg#81004)
- Tabs: Support Home and End keys for keyboard navigation (WordPress/gutenberg#80912)
- Rename blockStatesEnabled setting to blockStatesEditingEnabled (WordPress/gutenberg#81058)
- [WP 7.1] Background: Fix the legacy gradient UI where a gradient cannot be selected (WordPress/gutenberg#81059)
- Views: honor developer-defined view config overrides (WordPress/gutenberg#80832)
- Playlist: Add track icon (WordPress/gutenberg#81078)
- Remove the CODEOWNERS file from wp/7.1. (WordPress/gutenberg#81104)
- Notes: Email users mentioned in a note (WordPress/gutenberg#79606)
- Backport 81068 80744 80642 (WordPress/gutenberg#81135)
- Site Editor: Add E2E coverage for view config extensibility (WordPress/gutenberg#80577)
- change from WordPress/gutenberg#81068 (WordPress/gutenberg#81140)
- Link Control: Restore the preview title underline (WordPress/gutenberg#81083)
- Button: Suppress UA focus ring when focused and pressed (WordPress/gutenberg#81113)
- View config: add reference docs (WordPress/gutenberg#81149)
- Editor: Fix document tools button focus ring (WordPress/gutenberg#81115)
- Interface: Increase footer breadcrumb height to prevent focus ring clipping (WordPress/gutenberg#81156)
- Post editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81112)
- Pass Playlist controls to track blocks (WordPress/gutenberg#81158)
- Theme: Omit color properties when neither provided nor inherited (WordPress/gutenberg#80600) (WordPress/gutenberg#81172)
- Media: Improve the HEIC upload error and keep any upload errors up until dismissed (WordPress/gutenberg#81130)
- Video: Hide settings for the GIF variation (WordPress/gutenberg#81142)
- Video: clarify the Video variation description (WordPress/gutenberg#81181)
- Button: turn on the width setting by default in theme.json (WordPress/gutenberg#81196)
- Edit Widgets: Fix header toolbar button focus ring (WordPress/gutenberg#81176)
- Build: Wrap script bundles in an IIFE to contain 'use strict' (WordPress/gutenberg#79792)
- Customizer widgets: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81174)
- Fix: Tabs block: Start with empty tab labels with placeholders (WordPress/gutenberg#81197)
- PanelColorSettings: Restore the missing space below the panel header (WordPress/gutenberg#81155)
- Visual revisions: add shareable urls (WordPress/gutenberg#81205)
- Notes: fix the mention notification email composition (WordPress/gutenberg#81187)
- Fix ESLint warnings for 'navigateRegionsProps' spread (WordPress/gutenberg#81208)
- Widgets editor: Add ThemeProvider for admin color schemes (WordPress/gutenberg#81173)
- Remove the editableRoot opt-in from the paragraph block (WordPress/gutenberg#81184)
- Media Attached to: Fix issue with the popover unexpectedly flipping, tweak wording (WordPress/gutenberg#81206)
- Ensure device preview is always accurate when window is zoomed in (WordPress/gutenberg#81215)

Props wildworks.
See #65529.

git-svn-id: https://develop.svn.wordpress.org/trunk@63026 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backported to WP Core Pull request that has been successfully merged into WP Core [Block] Quote Affects the Quote Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block editor /packages/block-editor [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quote: backspace in a nested list should lead to a default block

4 participants

Sponsor
SponsoredKunjungi sekarang
Promo