Bug report.
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
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!
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.
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.