Behaviour SwRS-MDOKFSTUDIO-BLOCK-130
Alt+Up and Alt+Down move the focused block, also from the text box
When a writer presses Alt+ArrowUp or Alt+ArrowDown on a focused body block in edit mode, the page SHALL request the move of that block and focus the block at its new place, and the move chord in the text box of a block editor does the same after saving the edit and reopens the editor with the caret where it was.
Step 1 of path 2 in StRS-MDOKFSTUDIO-BLOCK-014: from “A body block is focused in edit mode” to “The host is asked to swap the block with its neighbour”.
Scenarios 7
The situations the tests check; open one to read it.
nominalAlt+Arrow on a focused block or insert point
| Input | Outcome |
|---|---|
| Alt+ArrowDown on a focused body block, edit mode on | previewBlockMove is posted for that block and, after the render, the block at its new line has the focus; one message per key press |
| Alt+ArrowUp or Alt+ArrowDown with the plus button of a bar focused | previewBlockMove is posted for the block above the bar |
| Alt+ArrowUp on the first block | Nothing is posted |
| Alt+ArrowDown with the bar of the properties table focused | Nothing is posted |
boundaryA key repeat does not move a block twice
| Input | Outcome |
|---|---|
| The key repeat event arrives while a keyboard move waits for its result and render | No second message is posted |
| The result and the render of the move have arrived and the writer presses the chord again | A new move is requested |
refusalOther chords and targets do not move a block
| Input | Outcome |
|---|---|
| Shift+Alt+Arrow or Ctrl+Alt+Arrow on a focused block | No move is posted |
| Alt+Arrow with Cmd | No move is posted |
| Plain Alt+Arrow with the focus in a text box | The key stays with the text box and no move is posted |
| Alt+Arrow in an input, select or editor, in the properties table, outside edit mode or during an open editor | No block move starts |
refusalA refused keyboard move can be retried
Givena keyboard move whose result is ok false
Whenthe result arrives
the writer presses the chord again
the writer presses the chord again
Thenthe flight is cleared, the block has the focus and the reason shows next to the bar under the block
a new previewBlockMove is posted
a new previewBlockMove is posted
boundaryA keyboard move that never lands is forgotten after five seconds
| Input | Outcome |
|---|---|
| A keyboard move in flight and no result for five seconds | The flight is cleared and a new chord is accepted |
| The result arrives after one second | The timer has been cleared |
nominalThe move chord in the text box moves the block and reopens its editor
The move chord is Cmd+Alt with ArrowUp or ArrowDown on macOS and Ctrl+Alt elsewhere.
| Input | Outcome |
|---|---|
| An editor with typed text and the caret at offset 12, the chord down | The final save is posted, then the block is moved, and the editor of the block at its new place opens with the caret at offset 12 |
| An editor opened and not changed, the chord | The editor closes, the host drops the edit and previewBlockMove is posted at once |
refusalThe move chord is always consumed in the text box
| Input | Outcome |
|---|---|
| The chord in the editor of the last block (no neighbour) | The key is consumed and nothing else happens |
| The chord while a move is already in flight | The key is consumed and nothing else happens |
| The chord in an insertion editor | No word navigation happens and nothing moves |
| The chord in a table cell, or as a key repeat | The key is consumed and nothing moves |
| AltGr with an arrow, on a layout where AltGr reports Ctrl and Alt together | The key stays native and moves the caret; AltGraph is never part of the chord |
| Option or Alt with an arrow, without Cmd or Ctrl (or without Cmd+Alt on macOS) | The key stays native and moves the caret by word; the chord itself is Cmd+Alt on macOS and Ctrl+Alt elsewhere |