ianstormtaylor / slate

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

Exception thrown at replace text when user has selected the end line marker #1280

Closed kashifimran closed 6 years ago

kashifimran commented 6 years ago

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

Bug

What's the current behavior?

On http://slatejs.org/#/forced-layout (or any other example), put the cursor at the start of the heading/line. Then hold shift and hit "end" key, so that the whole line is selected. Now, while still holding the "shift" key, hit "right key", so that one extra character (new line marker?) is selected, thus extending the selection. Now type something to replace the content. An exception will be thrown. The following image shows the bug:

Forced layout bug

What's the expected behavior?

The content of the heading should be replaced without exception being thrown.

ianstormtaylor commented 6 years ago

Hey, thanks for reporting this. I think this is actually a duplicate of #1189, so I'm going to close this in favor of that one. Feel free to comment over there with any other info!