gutenberg-mobile icon indicating copy to clipboard operation
gutenberg-mobile copied to clipboard

Editor doesn’t scroll with the block/cursor when I move a block

Open marecar3 opened this issue 6 years ago • 2 comments

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:

  1. Create or open a post with a lot of content.
  2. Select a block.
  3. Tap the up/down arrows to move the block until it goes off screen. Result: The editor doesn’t scroll with the block.

marecar3 avatar Mar 12 '19 16:03 marecar3

This one is still reproducible on the current Demo app.

marecar3 avatar Jul 01 '19 17:07 marecar3

Considerations:

  1. 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.
  2. 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.
  3. 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.

guarani avatar Jul 20 '20 23:07 guarani