Gutenberg: List block: list breaks when a new subitem is added using the keyboard.

Created on 17 Oct 2018  路  5Comments  路  Source: WordPress/gutenberg

Describe the bug
Using the keyboard to add a new subitem in a list breaks the list.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new "List" block.
  2. Add any text to create some items.
  3. Select at least one of these items and click on the "Indent list item" icon to create one o more subitems.
  4. Now, click on the end of one of the subitems and hit "Return" in your keyboard.
  5. The list will break as a result.

Expected behavior
To create new subitems, would be sufficient to hit "Return" while the cursor is at the end of a subitem. This is how main items on the list are created by default, but it doesn't work for subitems.

You can only create subitems by clicking on the "Indent list item" icon. The keyboard can't be used for this at all or the list will break.

Screenshots

list-block-subitem-issue

Desktop:

  • MacOS X 10.12
  • Chrome 69

Additional context

  • Gutenberg 4.0.0
  • WordPress 4.9.8
  • Twenty Seventeen.
  • No other plugins.
[Block] List [Priority] High [Type] Bug [Type] Regression

All 5 comments

Good find! Tested and confirmed using WordPress 4.9.8 and Gutenberg 4.0 with Firefox 62.0.3 on macOS 10.13.6. (2m5s)

Thanks, working on it :)

I have a fix for this, but it needs more tests. I'll finish it tomorrow.

Also noticed some other issues with nested blocks and serialisation.

Punted but if it makes the cut for 4.1, we include it. We can also include it during RC period as it's an important bug fix.

Was this page helpful?
0 / 5 - 0 ratings