Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-TABLE-025

Escape cancels the open cell edit only, except during a composition

When the writer presses Escape in a cell editor outside an IME composition, the extension SHALL close the editor and drop the text typed in that cell only, keep the text of the cells left earlier in the session with Tab, an arrow key or a click, show in the preview what the buffer holds, remove a row that Tab added in that session when every cell of it is empty, and, during an input-method composition, leave the editor open and post nothing.

Another outcome at step 3 of path 1 in StRS-MDOKFSTUDIO-TABLE-001, in the state “The typed text is in the table model”.

Scenarios 16

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

nominalEscape after typing
Givena cell edited and not yet autosaved
Whenthe writer presses Escape
Thenthe editor closes, the rendered cell is as before and no final previewEditSave is ever posted
nominalEscape after a cell left with Tab, an arrow key or a click
Giventext typed in a cell, then Tab, an arrow key or a click to another cell, and text typed in that cell
Whenthe writer presses Escape in the second cell
Thenthe editor closes, the buffer holds the text of the first cell and the original text of the second, and the preview shows both as the buffer holds them
boundaryEscape in an unchanged cell after a cell left
Giventext typed in a cell and left with Tab, and nothing typed in the next cell
Whenthe writer presses Escape
Thenthe text of the first cell stays in the buffer
nominalCancel button after a cell left
Giventext typed in a cell, then Tab to another cell, and text typed in that cell
Whenthe writer clicks the Cancel button of the cell editor
Thenit behaves as Escape: the buffer holds the text of the first cell and the original text of the second, and no previewEditCancel is posted
boundaryEscape after leaving an untouched cell
GivenTab out of a cell where nothing was typed, then text typed in the next cell
Whenthe writer presses Escape
Thenthe whole session is cancelled as before: no final save is posted
nominalEscape on an empty row added by Tab
Giventhe editor in the last cell of a table, Tab pressed there, and the editor reopened in the first cell of the new empty row
Whenthe writer presses Escape
Thenone final previewEditSave is posted whose text is the table without the new row (the table before the Tab, except the text typed in the cell where Tab was pressed), no previewEditCancel is posted and the editor closes; one undo from the source gives the empty row back and a second one undoes the Tab
nominalCancel on an empty row added by Tab
Giventhe editor reopened in the empty row that Tab added
Whenthe writer clicks the Cancel button
Thenit does the same as Escape: the row is removed with one final save
boundaryEscape on a row added by Tab after typing in it
Giventhe editor reopened in the row that Tab added, and text typed in its first cell only
Whenthe writer presses Escape
Thenthe typed text is dropped (the open cell returns to its opening text), the row is empty and is removed
boundaryA row added by Tab with a cell left holding text
Giventhe editor reopened in the row that Tab added, text typed in its first cell, then Tab to its second cell
Whenthe writer presses Escape
Thenthe row stays with the text of its first cell, as in the scenarios above
boundaryA row added with the Row below button
Giventhe editor reopened in the row that the Row below button added
Whenthe writer presses Escape
Thenthe row is not removed: no final save without it is posted
boundaryBlur after Escape
Giventhe editor closed by Escape
Whenthe focus then moves elsewhere
Thennothing is sent
nominalEscape or Cancel in a cell during a final save closes the editor with no message
Givena cell editor whose final save is in flight, with a cell left earlier, a row added by Tab, or the focus outside the cell editor
Whenthe writer presses Escape or Cancel
Thenthe editor closes with previewEditClosed and no previewEditCancel and no second final save, and the save completes with the text finished
nominalEscape with the focus outside the cell editor
Givena cell editor open and the focus on another element of the page
WhenEscape is pressed while the key target and the active element are outside the cell editor
Thenthe edit is cancelled as if Escape had been pressed in the text box
boundaryKey inside the editor
GivenEscape pressed in the cell text box
Whenthe document-level handler sees the key
Thenit does nothing, the text box handler having cancelled once
refusalEscape during a composition
Givenan IME composition in progress in the cell text box
WhenEscape is pressed (event marked as composing)
Thenthe editor stays open and nothing is posted
boundaryEscape after the composition
Giventhe composition ended
WhenEscape is pressed
Thenthe edit is cancelled

Implemented in 4

Tested by 8