slate icon indicating copy to clipboard operation
slate copied to clipboard

Delete empty paragraph element automatically turn previous empty list-item element to paragraph.

Open Jokcy opened this issue 2 years ago • 1 comments

Description Delete empty paragraph element automatically turn previous empty list-item element to paragraph.

Recording slate-issue

Sandbox A link to a sandbox where the error can be reproduced. (You can start from the base sandbox here: https://codesandbox.io/s/slate-reproductions-c7gyg or refer to the Slate website too.)

You can reproduce it at the offical example

Steps To reproduce the behavior:

  1. Add an paragraph element at the end of documenet
  2. Add a new list-item element before that paragraph and leave it empty
  3. Delete the content of paragraph
  4. After delete all content of paragraph, you will see the previous list-item element being converted to paragraph.

Expectation Only focus on the list item element but not convert its type.

Environment

  • Slate Version: [e.g. 0.82]
  • Operating System: [e.g. mac os]
  • Browser: [e.g. Chrome]

Jokcy avatar Aug 13 '22 04:08 Jokcy

Hey! I'm going to try to fix this problem the problem that I see is that if we have an empty list item and below it an empty paragraph and if we delete an element from an empty paragraph we also delete the empty item of the list and instead converts the list item into a paragraph . Just want to clarify that the fix here would be : when empty paragraph element gets deleted it must take our cursor to the empty list item and allow us to append content to the empty list item.

AryanMankame avatar Sep 20 '22 14:09 AryanMankame