Slate: Shift-select with the arrow keys fails when selecting toward an inline void node

Created on 10 Jan 2018  Â·  3Comments  Â·  Source: ianstormtaylor/slate

Hey folks! This one's a bit odd. GIF below! In the GIF, I am holding down the shift key the whole time. (I haven't attached a JSFiddle because it's reproduced on http://slatejs.org/#/emojis.)

jan-10-2018 14-18-04

Observations:

  • Happens in both Firefox Beta and stable Chrome.
  • You can shift-select with the arrow keys away from an inline void node. Eg: "shift right arrow" past the last void node, or "shift left arrow" before the first void node works.
  • You cannot shift-select with the arrow keys toward an inline void node.
bug ♥ help

Most helpful comment

This is happening because nextText is the zero-width text node slate inserts. As a result, the condition is true and we collapse the selection forward instead of extending it.

I've made a PR which deals with this issue, I still need to check it deals with the other cases and doesn't cause any regressions.

slate-selection

All 3 comments

This is happening because nextText is the zero-width text node slate inserts. As a result, the condition is true and we collapse the selection forward instead of extending it.

I've made a PR which deals with this issue, I still need to check it deals with the other cases and doesn't cause any regressions.

slate-selection

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chrpeter picture chrpeter  Â·  3Comments

ianstormtaylor picture ianstormtaylor  Â·  3Comments

AlexeiAndreev picture AlexeiAndreev  Â·  3Comments

vdms picture vdms  Â·  3Comments

yalu picture yalu  Â·  3Comments