List Item Block: Fix deletion of empty list items with nested children#71482
List Item Block: Fix deletion of empty list items with nested children#71482dhruvikpatel18 wants to merge 1 commit intoWordPress:trunkfrom
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. |
|
This worked great for me while testing! Thanks for working on it. @Mamaduka is this something you could quickly review? |
|
Sorry for the late reply. Looking at the failing e2e tests, they seem to be related to this change. We shouldn't regress other functionality, while fixing bugs :) @dhruvikpatel18, do you mind rebasing this branch on top of the latest trunk? |
|
Closing this now that #73839 is merged. I've included @dhruvikpatel18 in the props list. Thanks again, @dhruvikpatel18! |
Closes #56223
What?
Fixes the deletion behavior of empty list items that contain nested sub-items, ensuring nested items are promoted to top-level instead of being deleted entirely.
Why?
Currently, when you delete an empty list item at the top of a nested list structure, all nested items underneath are also deleted. This is unexpected behavior - users expect the nested items to be promoted to become top-level list items instead of being lost entirely. This creates a poor user experience and potential data loss.
Testing Instructions
Screenshots or screencast
Before
List.Item.block.before.mov
After
List.Item.block.after.mov