-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
List block removal fails #45919
Comments
Hi @RolfKyburz , |
@sunil25393, sorry, I don't have the resources to do what you suggest — however, now may have the essential clue for what is happening. I can indeed insert a list, select the list block, and delete it — and there are no traces. What happened here is that I am working with templates with lists that were created in WP versions older than 6.1.1, where list blocks were structured entirely differently. I can fix my templates — however, the problem remains a nuisance whenever one is editing WP pages / posts created under older WP versions. |
Thank you for the additional details. The list block went from being a "simple" block to being a "nested" block where individual list items can be handled separately. It sounds like this could be causing the problem. Could you please share the exact HTML you are using on your lists (you can switch to the "Code view" for this)? Working with the exact same HTML as you will help us get a better idea of what is happening and how to to fix it. https://cloudup.com/cVIs40LBnm0 Thank you! |
Hmmm ... it's not as easy as I thought. I see that in WP 6.1.1, old style lists are automatically converted to the "split block" scheme. I may have found what the problem is: in my templates, I often have a list with one placeholder item in it. Up to WP 6.1, I could simply place my cursor on that placeholder item and use Ctrl-Alt-Z to remove the list. With WP 6.1.1, this simple removes the list item, and when the last item in a list is deleted, this leaves an empty list item, i.e.,
Only if I select the parent item first, then use Ctrl-Alt-Z, the list is fully removed. IMO, the removal of the last list item (possibly only when it is empty) should remove the list, i.e., the parent block. On a side-note, I see the advantages if the nested block scheme for lists, but I also see problems with this, such as
|
I found a similar issue, although they may not be identical to the problem you reported.
This problem occurs in both WordPress 6.1 and 6.1.1 and is independent of whether or not the latest Gutenberg is enabled. cd44380d0c42d54fc0a384e50dc14349.mp4
It would be a good idea to submit these suggestions as new issues, if necessary. |
Hi @t-hamano — yes, that is exactly my initial problem — thanks for confirming. As for my additional observations / suggestions, I'll create two extra issues from these. |
I suggest either of the following approaches to solve this problem: 1. When the last list item is deleted, the parent list should also be deleted2. Provide some UI to indicate that there are no list itemsThis second approach is a reference to the social icon block. Placeholder icons appear when no icon is present: When a block is selected, text appears prompting the user to add an icon: |
I think this needs a UX solution more than anything, so I'm adding the Needs Design label. |
Thanks for creating separate issues for your other observations! The initial problem is a duplicate of #40979 (which also has a PR to fix it), so I will close this one. Thank you! |
Description
In WP 6.1.1 (not in WP 6.1), removing a list block appears to work initially. However, a look at HTML reveals that the list block is not entirely removed, as a part of the code remains in the document, e.g.,
or, in a block with CSS additions,
In the moment of the deletion, the list visually disappears, but when re-editing the document later, the list block reappears. The only functioning way to remove the block appears to be, by manually removing the above code in HTML mode.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WP 6.1.1, PHP 8.0.25, Theme: Exhibit 1.04, parent theme GeneratePress 3.2.3
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
No
The text was updated successfully, but these errors were encountered: