Behaviour SwRS-MDOKFSTUDIO-BLOCK-004
Arrow keys, Enter and Escape drive block editing without the mouse
When edit mode is on and no editor is open, the page SHALL move a one-block selection with ArrowUp and ArrowDown, open the selected block with Enter, and, when an editor closes through Escape or Cmd/Ctrl+Enter, leave the edited block selected; the keys SHALL work while the page itself holds the focus, and a window or tab that comes back SHALL restore the selection.
Part of StRS-MDOKFSTUDIO-BLOCK-008, outside the paths drawn on its map.
Scenarios 5
The situations the tests check; open one to read it.
nominalUp and Down select, Enter opens, Escape or Cmd/Ctrl+Enter returns to the selection
The selection is the one of SwRS-MDOKFSTUDIO-BLOCK-140: it is outlined in the focus colour, scrolled into view, takes the focus and is announced as "1 block selected". After a save, the block is selected once the patch of the save is in; when the save changed the number of blocks, nothing is selected.
boundaryMoving the selection
| Input | Outcome |
|---|---|
| ArrowDown on the last block, ArrowUp on the first | The selection stays |
| ArrowUp or ArrowDown with a run of blocks selected | The run collapses onto the neighbour of its free end |
| A neighbour that comes from an include | It is skipped |
| Enter with no selection | Nothing opens |
| Enter on the page itself (the focus lost to the body) with a selection | The editor of the free end of the selection opens |
| Delete or Backspace with a block selection | The selected blocks are deleted (SwRS-MDOKFSTUDIO-BLOCK-265) |
| Delete or Backspace with only a focused block, a focused bar button, a text box, an open editor, or the structural cursor on a cell, a list item or an inner block | Nothing is deleted |
nominalComing back to the window
refusalKeys that belong to other controls
| Input | Outcome |
|---|---|
| ArrowUp, ArrowDown or Enter with edit mode off | Nothing is selected or opened |
| ArrowDown in a block editor text box, a field or the properties table | The key stays with that control |
| ArrowDown with Shift, Alt, Ctrl or Cmd | Not handled here: Shift extends a run (BLOCK-140), Alt moves the block |
| ArrowDown on the edit-mode toggle right after it was pressed | Handled as on the page |
| The window comes back with a toolbar button, a block or an editor focused, or outside edit mode | The selection is left as it is |
Table-cell editors keep their own Escape and Cmd/Ctrl+Enter and do not select a block when they close.