Editor doesn’t scroll with the block/cursor when I move a block
Expectation: When I move a block up and down in a post, I expect the editor to scroll so that the selected block and the cursor are always in view.
Actual: If I move the block up or down so that the block goes out of the visible area, the editor does not scroll automatically. I have to swipe to scroll the block back into view. (This is especially annoying if I’m trying to move a block a ways up or down in the post, as I have to alternate between moving the block and swiping to see it again.)
To repro:
- Create or open a post with a lot of content.
- Select a block.
- Tap the up/down arrows to move the block until it goes off screen. Result: The editor doesn’t scroll with the block.
This one is still reproducible on the current Demo app.
Considerations:
- If the user moves a block up beyond the top edge of the screen, automatically scroll the screen down until the top of the block is visible.
- If user moves a block down beyond the bottom edge of the screen, automatically scroll the screen up until the bottom of the block is visible.
- How do we handle blocks that don't fit on the screen? The visible screen space can be significantly reduced by the virtual keyboard. Also, the virtual keyboard is not always visible when an input has focus (e.g. when using an external keyboard).
There's already been work done to handle keyboard focus here, although this issue relates to moving blocks, regardless of whether or not the keyboard is visible. Side-note: in tests today, I noticed that when moving a block down, we close the virtual keyboard on both Android and iOS.
If the scrolled block has a cursor present (i.e. it's a block that contains an input field and the input field has focus), I think ensuring that the cursor is visible is most important. Of secondary importance is ensuring that the block toolbar is visible because it provides access to block options and other important functionality.