ianstormtaylor / slate

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

Paragraphs are unnecessarily merged #3466

Open kleinspire opened 4 years ago

kleinspire commented 4 years ago

Do you want to request a feature or report a bug?

Bug

What's the current behavior?

https://codesandbox.io/s/slate-reproductions-x6nf8

Put cursor inside bold text Tap backspace until you're at 2 Press backspace again Number 2 is deleted and both paragraphs are merged into one

Slate: 0.57.1 Browser: Chrome OS: Linux

What's the expected behavior?

Number 2 is deleted without merging the paragraphs into one

dimitriadamou commented 4 years ago

Does this happen on the 0.58 version? https://codesandbox.io/s/slate-reproductions-2yr90?file=/index.js

Testing from Mac on Chrome, no replicable issue May-06-2020 19-24-31

kleinspire commented 4 years ago

@dimitriadamou Yes, the bug is still there. I just tested it on both Windows and Linux version of Chrome. Btw you need to put the cursor in the MIDDLE of the bold text before tapping backspace in order to replicate the bug.

dimitriadamou commented 4 years ago

Ah I see now, if I get time over the weekend I may have a play with it

udayanshevade commented 3 years ago

Looks like a duplicate of #3339

I took a crack at fixing it:

richtext_char_backspace_fix_2