Slate: Unable to move cursor back past inline nodes

Created on 18 Feb 2019  ·  4Comments  ·  Source: ianstormtaylor/slate

Do you want to request a _feature_ or report a _bug_?

Bug report.

What's the current behavior?

Currently, when placing multiple inlines, including void inlines, you can create a situation whereby the cursor no longer moves backwards with the key. I believe this might be due to the fact that slate is setting the offset to '-1' and then instantly updating it to '0' onKeyDown.

This behaviour is 100% reproducible with three inlines side by side, the middle one not containing any text. Simple example can be found here: https://codesandbox.io/s/mqxrkz55vp

You will find that it is possible to move the cursor forward to the end of the text with but not go beyond the second node when moving back with .

(it's difficult to demonstrate this issue with a gif given it's to do with cursor location and keypresses!)

Test system:
MacOS 10.14.2, Chrome 72.0.3626.109
Slate 0.44.10
Slate-React 0.21.16

What's the expected behavior?

You should be able to move the cursor back past void inlines using arrow keys.

Thanks, let me know if there's anymore I can provide!

bug

Most helpful comment

Yes, definitely not working for me on codesandbox, able to move cursor from beginning to end without issue but when tapping back arrow the cursor gets stuck at the void node and only continues when held down.

All 4 comments

Yes, definitely not working for me on codesandbox, able to move cursor from beginning to end without issue but when tapping back arrow the cursor gets stuck at the void node and only continues when held down.

I'm also having this problem. Is there any known workaround so the cursor moves smoothly across?

Hey guys! I am having the same problem :( Any approach/suggestion ?

PS: @patricknasralla the code sandbox link is broken

I believe that this may be fixed by https://github.com/ianstormtaylor/slate/pull/3093, which has changed a lot of the logic in Slate and slate-react especially. I'm going to close this out, but as always, feel free to open a new issue if it persists for you. Thanks for understanding.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ezakto picture ezakto  ·  3Comments

adrianclay picture adrianclay  ·  3Comments

JSH3R0 picture JSH3R0  ·  3Comments

chriserickson picture chriserickson  ·  3Comments

chrpeter picture chrpeter  ·  3Comments