Behaviour SwRS-MDOKFSTUDIO-TABLE-018
Enter, Done, leaving the cell or a click elsewhere commits the cell
When the writer presses Enter in the cell text box, with or without Cmd, Ctrl or Shift, presses Done, leaves the cell editor or clicks elsewhere on the page, the extension SHALL insert no line break and commit the cell by posting the table as a final previewEditSave, and post no save when the table text equals the text the host sent and no autosave reached the document.
Step 3 of path 1 in StRS-MDOKFSTUDIO-TABLE-001: from “The typed text is in the table model” to “The cell is committed and the editor is closed”.
Step 2 of path 1 in StRS-MDOKFSTUDIO-TABLE-015: from “The cell text is formatted” to “The cell is saved with its formatted text”.
Scenarios 8
The situations the tests check; open one to read it.
nominalEnter after typing
Givena cell edited from "a" to "ab"
Whenthe writer presses Enter
Thena final previewEditSave with the edited table is posted, the status reads "Saving Markdown…" and the text box value holds no line break
boundaryEnter chords and the Done button
| Input | Outcome |
|---|---|
| Shift+Enter, Cmd+Enter or Ctrl+Enter in the edited cell | the same final save is posted |
| the pointer pressed on Done after typing, then the button clicked | a final previewEditSave is posted, and the focus stays in the text box until the click, so the loss-of-focus commit does not run first |
boundaryAn unchanged cell closes without a save
| Input | Outcome |
|---|---|
| a cell opened and not changed, Enter pressed | the editor closes and no previewEditSave is posted |
| a cell editor with no change, Done clicked | no save is posted and the editor closes |
| a cell changed, autosaved, then typed back to the original text, Enter pressed | a final previewEditSave is posted, because the document no longer holds the original text |
nominalFocus leaving the cell editor
| Input | Outcome |
|---|---|
| a cell edited and the focus moved to another element of the page, more than 500 ms after the last pointer press, when the zero-delay check after the blur runs | a final previewEditSave is posted and the editor closes |
| a cell edited and the focus moved to a button of the table bar or to Done | nothing is saved and the editor stays open |
| the whole window lost the focus (the check treats a document without focus as outside) | the cell is committed |
boundaryA pointer press in the last 500 ms
| Input | Outcome |
|---|---|
| a pointer pressed 100 ms ago on another cell and the cell text box blurred | no save is posted by the blur; the click handler of the other cell decides |
| the last pointer press 600 ms ago and the blur check runs with the focus outside | the cell is committed |
nominalFocus leaving the cell formatting group
Giventhe emoji picker open from the cell bar and the focus moved inside the bar
a host file dialog opened from the cell bar
a host file dialog opened from the cell bar
Whenthe focus then leaves to nowhere
the focus leaves the page for the dialog
the focus leaves the page for the dialog
Thenthe cell is committed with a final previewEditSave; while the focus was inside the bar nothing was saved
the cell is not committed by the group's leave handler
the cell is not committed by the group's leave handler
nominalA click on a block outside the table
Givena cell edited and a paragraph outside the table clicked
an unchanged cell editor and a click on another block
an unchanged cell editor and a click on another block
Whenthe click is handled
the click is handled
the click is handled
Thenthe final previewEditSave is posted first, the click target is remembered as a pending navigation and the paragraph opens after the re-render
the cell editor closes without a save and the other block opens at once
the cell editor closes without a save and the other block opens at once
nominalA click outside any editable block or on a link
Givena cell edited and edit mode on
a cell whose final save was already posted
a cell whose final save was already posted
Whenthe writer clicks an area of the page that belongs to no editable block, or a link
the writer clicks the empty area again
the writer clicks the empty area again
Thena final previewEditSave with the edited table is posted
no second save is posted
no second save is posted