Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TABLE-123

Tab and the arrow keys move between table cells

When the writer presses Tab, Shift+Tab or an arrow key at the edge of the text in a cell text box, the extension SHALL move the editor to the next, previous or neighbouring rendered cell with the caret at the end of its text (at the start for the cell to the right and the cell below), and SHALL leave the key to the browser or hand it to block-to-block navigation when no cell can take it.

Step 1 of path 1 in StRS-MDOKFSTUDIO-TABLE-006: from “A cell editor is open” to “The editor is in the neighbouring cell”.

Scenarios 7

The situations the tests check; open one to read it.

nominalTab along a row and across rows
Givena two-column table with a header row and two body rows, the editor in the first header cell
Whenthe writer presses Tab four times
Thenthe editor visits the second header cell, the first and second cell of the first body row, and the first cell of the second body row, each with the caret at the end of its text, with the same edit session and no final save
boundaryShift+Tab and held modifiers
InputOutcome
Shift+Tab in the first cell of the first body row of a two-column tableThe editor moves to the second header cell with the caret at the end of its text
Shift+Tab in the second header cellThe editor moves to the first header cell
Shift+Tab in the first header cellThe editor stays in that cell and the key is prevented
Ctrl+Tab in a cell (Tab with Cmd, Ctrl or Alt is not handled by the cell editor)The editor does not move
Shift+Ctrl+Tab in a cellThe editor does not move
nominalArrowLeft and ArrowRight at the edges of the text
Giventhe editor in the first body cell with the caret at the end of its text
Whenthe writer presses ArrowRight, then ArrowLeft at the start of the second cell
Thenthe editor moves to the second cell with the caret at its start, then back to the first cell with the caret at its end; the moved-from cell text is autosaved, with no final save
nominalArrowUp and ArrowDown at the first and last line
Giventhe editor in the first body cell of a table with two body rows
Whenthe writer presses ArrowDown at the end of the text, then ArrowUp at the start of the next cell
Thenthe editor moves to the cell below with the caret at its start, then back up with the caret at the end of the upper cell
boundaryKeys that stay native
InputOutcome
Caret in the middle of the text, ArrowRightThe key stays native and the caret moves within the text
Cell text wrapped over several visual lines, caret on the middle line, ArrowUp or ArrowDownThe caret moves between the visual lines; the editor leaves the cell only from the first or the last visual line
All of the text selected, or Shift, Alt, Cmd or Ctrl held, caret at an edge, an arrow keyThe key is not prevented and the editor stays in its cell
IME composition in progress, caret at an edge, an arrow keyThe editor stays in its cell
Rendered table with a third column in the row below that the Markdown model lacks, editor at the end of the text in the second column, ArrowRightThe key is not prevented and the editor stays in its cell
The same table with a matching third cell in the model, ArrowRightThe editor moves to that cell
End pressed with Cmd, Ctrl or Alt, or during an IME compositionThe cell editor leaves it to the browser
boundaryNo cell in the arrow direction
Giventhe editor in the first header cell with the caret at the start and a block above the table
Whenthe writer presses ArrowUp
Thenthe key is consumed and the page posts a previewEditOpen for the block above

The same hand-over to the next block applies with the editor in the last column of the last row when the writer presses ArrowRight at the end of the text, then ArrowDown at the last line.

nominalHome and End in a wide table
Giventhe editor in the far-right cell of a sixteen-column table wider than the pane
Whenthe writer presses End
Thenthe caret goes to the end of the cell text, the default action is prevented, and neither the page nor the table scrolls

Home moves the caret to the start of the text, and Shift extends the selection.

Implemented in 2

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-TABLE-035Tab and the arrow keys move through the table cells superseded superseded by SwRS-MDOKFSTUDIO-TABLE-123, SwRS-MDOKFSTUDIO-TABLE-124, SwRS-MDOKFSTUDIO-TABLE-125, SwRS-MDOKFSTUDIO-TABLE-126 Markdown file