ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

When cutting (ctrl+x) nodes containing a list, the new node remains a 'list-item' #3801

Open Teipo opened 4 years ago

Teipo commented 4 years ago

What's the current behavior?

When I a cut (ctrl+x) a section in Slate that contains a list, sometimes the leftover node remains a 'list-item' and is not a 'paragraph'. This typically happens if the last marked node type is a list or the last marked node does not contain any text and the node before it is a list.

It happens in production: https://www.slatejs.org/examples/richtext

gif

Slate: 0.58.4 Browser: Chrome OS: Windows

What's the expected behavior?

The leftover node becomes a 'paragraph' and not a 'list-item'

eshavrov commented 4 years ago

A similar problem occurs when you select elements that start with nested elements (such as a list) when trying to delete (by pressing the Backspace key).