Behaviour SwRS-MDOKFSTUDIO-BLOCK-140
Shift+click and Shift+Arrow select a run of blocks
When a writer Shift+clicks a body block, or presses Shift+ArrowUp or Shift+ArrowDown on a focused body block or on the selection, in edit mode, the page SHALL select a run of body blocks, from the anchor block to the clicked block or to the free end of the selection, and open no editor.
Step 1 of path 1 in StRS-MDOKFSTUDIO-BLOCK-016: from “Edit mode is on and no editor is open” to “A run of blocks is selected”.
Scenarios 8
The situations the tests check; open one to read it.
nominalShift+click selects every body block from the anchor to the clicked block
Shift+mousedown on the block is the first half of this gesture; see the mousedown scenario below.
boundaryThe anchor is the block clicked or opened last
| Input | Outcome |
|---|---|
| Shift+click with no selection, after a block was opened or clicked earlier, and the number of blocks is unchanged | The range starts at the block opened or clicked earlier |
| Shift+click with no selection, after blocks were added or removed since the anchor was remembered | The clicked block becomes the anchor |
nominalShift+Arrow grows and shrinks the selection
A first Shift+Arrow from a focused block selects two blocks (the block and its neighbour), not one. At the end of the document the selection stops: with the last block focused, Shift+ArrowDown selects only that block.
nominalSelected blocks are outlined and announced
| State | Outcome |
|---|---|
| Two blocks selected | Both carry `data-sphinx-preview-block-selected` true (a code block carries it on its `pre` element) and are outlined with a two pixel solid line in the focus colour; the status region has role status and aria-live polite and reads "2 blocks selected" |
| One block selected | The status region reads "1 block selected" |
| Selection cleared | No element carries the attribute and the status region is empty |
nominalEscape or a plain click clears the selection
refusalReading mode
refusalKeys that belong to other controls or chords
| Input | Outcome |
|---|---|
| Shift+ArrowDown in a block editor text box | The text selection extends and no block is selected |
| Shift+ArrowUp or Shift+ArrowDown in a field or in the properties table | The key stays with that control; the keydown handler returns |
| Shift+ArrowDown on a toolbar button or menu while a block selection exists | The selection is unchanged |
| Alt+Shift+ArrowDown, or an arrow with Shift and Ctrl, or with Shift and Cmd, on a focused block | No selection is made, so the Alt+Arrow move chords do not collide |
| Plain Shift+ArrowDown on the same focused block | The selection is made |
boundaryShift+mousedown on a block does not extend the browser text selection
| Input | Outcome |
|---|---|
| Shift+mousedown on a paragraph in edit mode | The default is prevented, so no browser text range extends under the block selection |
| Shift+mousedown inside a link | The browser default is kept |
| Shift+mousedown on a control, in the properties table, in an editor or on an insert point | The browser default is kept; preventDefault is called only for blocks |