Preserve nested list when deleting a selection across sibling list items#78776
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: +9 B (0%) Total Size: 8.44 MB 📦 View Changed
|
When deleting a multi-block text selection, the merge only combined block attributes, so inner blocks (e.g. a nested list) on the block merged away were dropped. Carry both blocks' inner blocks onto the surviving block. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
01fd1f2 to
0dce463
Compare
The merged result should keep only the inner blocks of the block whose text remains after the selection end; the first block's inner blocks sit inside the selected range and should be deleted with it. Add a test covering that case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Flaky tests detected in fd6d05f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/27132728887
|
What?
Fix a nested list being dropped when deleting a text selection that spans two sibling list items.
Why?
Deleting a multi-block text selection merged only block attributes, so inner blocks (e.g. a nested list) on the block merged away were lost. Backspace dropped them; Delete only kept them because the target happened to be the item that owned the nested list.
How?
In
__unstableDeleteSelection, carry both blocks' inner blocks (in document order) onto the surviving merged block.Testing Instructions
Testing Instructions for Keyboard
Make the selection in step 2 with
shift+arrow keys.Use of AI Tools
Authored with Claude Code (Claude Opus 4.7).