Skip to content
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: Deleting an empty item at the top of a (malformed) list reshuffles the block #55757

Open
Tracked by #53305
jasmussen opened this issue Nov 1, 2023 · 4 comments
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended

Comments

@jasmussen
Copy link
Contributor

This one is hard to describe, so it's best to test. Here's testing content:

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>Item<!-- wp:list -->
<ul><!-- wp:list-item -->
<li></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>Item</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item 2<!-- wp:list -->
<ul><!-- wp:list-item -->
<li>Item</li>
<!-- /wp:list-item -->

<!-- wp:list-item -->
<li>Item</li>
<!-- /wp:list-item --></ul>
<!-- /wp:list --></li>
<!-- /wp:list-item --></ul>
<!-- /wp:list -->

This will create two list items in a list, each item with further nested list items.

Notably the first nested list item of the first list item is empty. If you set focus on that block and press "backspace", suddenly you are focused in a new empty top level list item, as item 2. Expectation would be the list item was simply deleted.

GIF showing the above:

list view bug

@jasmussen jasmussen added [Type] Bug An existing feature does not function as intended [Block] List Affects the List Block labels Nov 1, 2023
@jasmussen
Copy link
Contributor Author

@ellatrix do you know what this might be?

@jordesign
Copy link
Contributor

Confirmed this one in testing with both WP 6.3.2 and 6.4RC3 - definitely an odd one.

@ellatrix
Copy link
Member

ellatrix commented Nov 6, 2023

@jasmussen That's because the list is malformed. In the list view you can see that the first list item contains two lists instead of just one. Instead of fixing the symptoms, it would be good to figure out how you ended up with this state. How did you create this list, step by step?

Screenshot 2023-11-06 at 11 32 32

@jasmussen
Copy link
Contributor Author

I got to this state by copying from Google Docs. I find this happens somewhat often, I usually take notes in a list form similar to the above, and when copying over those lists this happens. Feel free to DM me and I can send you the specific Google Doc I used to copy over.

@ellatrix ellatrix changed the title List: Deleting an empty item at the top of a list reshuffles the block List: Deleting an empty item at the top of a (malformed) list reshuffles the block Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants