Markdown OKF-Schema Studio

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
Givenedit mode on, a block opened or clicked earlier and another block further down
Whenthe writer Shift+clicks the further block
Thenthe page selects every body block from the anchor block to the clicked block, no editor opens and the browser text selection is cleared

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
InputOutcome
Shift+click with no selection, after a block was opened or clicked earlier, and the number of blocks is unchangedThe range starts at the block opened or clicked earlier
Shift+click with no selection, after blocks were added or removed since the anchor was rememberedThe clicked block becomes the anchor
nominalShift+Arrow grows and shrinks the selection
Givena focused block in the middle of five
Whenthe writer presses Shift+ArrowDown twice and Shift+ArrowUp once
Thenthe selection covers two, then three, then two blocks, the anchor never moves, the free end moves by one block and the focus follows the free end

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
StateOutcome
Two blocks selectedBoth 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 selectedThe status region reads "1 block selected"
Selection clearedNo element carries the attribute and the status region is empty
nominalEscape or a plain click clears the selection
Givena block selection in edit mode
Whenthe writer presses Escape outside a text box or field, or clicks a block without Shift
Thenthe selection is cleared, and on a plain click it is cleared before the block's editor opens; Escape inside an editor or a field keeps its own meaning
refusalReading mode
Givenedit mode off
Whenthe writer Shift+clicks a block
Thennothing is selected
refusalKeys that belong to other controls or chords
InputOutcome
Shift+ArrowDown in a block editor text boxThe text selection extends and no block is selected
Shift+ArrowUp or Shift+ArrowDown in a field or in the properties tableThe key stays with that control; the keydown handler returns
Shift+ArrowDown on a toolbar button or menu while a block selection existsThe selection is unchanged
Alt+Shift+ArrowDown, or an arrow with Shift and Ctrl, or with Shift and Cmd, on a focused blockNo selection is made, so the Alt+Arrow move chords do not collide
Plain Shift+ArrowDown on the same focused blockThe selection is made
boundaryShift+mousedown on a block does not extend the browser text selection
InputOutcome
Shift+mousedown on a paragraph in edit modeThe default is prevented, so no browser text range extends under the block selection
Shift+mousedown inside a linkThe browser default is kept
Shift+mousedown on a control, in the properties table, in an editor or on an insert pointThe browser default is kept; preventDefault is called only for blocks

Implemented in 2

Tested by 3