Behaviour SwRS-MDOKFSTUDIO-BLOCK-047
Done, Cmd/Ctrl+Enter or leaving the text box commits the edit
When a writer presses Done, presses Enter with Ctrl or Cmd in the text box, or moves the focus from the text box to something outside the editor frame, the page SHALL post the final previewEditSave of the text of the open editor and close the editor without any message when its text equals the original and nothing was autosaved.
Step 2 of path 1 in StRS-MDOKFSTUDIO-BLOCK-006: from “The typed text is in the document” to “The final text is saved”.
Part of StRS-MDOKFSTUDIO-PALETTE-013, outside the paths drawn on its map.
Step 3 of path 1 in StRS-MDOKFSTUDIO-PALETTE-005: from “The editor is open with the focus in the text” to “The edit is saved and the editor is closed”.
Scenarios 7
The situations the tests check; open one to read it.
nominalDone with changes
an editor with typed text and an autosave timer still running
the writer presses Done
the timer is cleared and the final save carries the latest text
refusalThe host refuses the final save
nominalCmd or Ctrl with Enter
| Input | Outcome |
|---|---|
| Ctrl+Enter in the text box with typed text | The default action is prevented and the final save is posted |
| Cmd+Enter in the same editor | The same final save is posted |
| Plain Enter | The editor is not finished |
nominalLeaving the text box
| Input | Outcome |
|---|---|
| Click outside the frame, with typed text | One final save is posted and the autosave timer is cleared |
| The browser window loses the focus with no related target | The final save is posted as well |
| Cmd/Ctrl+F in the text box (the find field takes the focus, see SwRS-MDOKFSTUDIO-TOOLBAR-009) | The final save carries the text typed before the key; the keys typed afterwards go to the find query |
boundaryMoving the focus inside the editor or into a host dialog does not commit
| Input | Outcome |
|---|---|
| The focus moves from the text box to a palette button, the link panel or the figure form of the same editor | No final save is posted and the editor stays open |
| The text box blurs while a file picker opened by an image or document action is pending | No final save is posted until the dialog is answered |
| A request marked as a native dialog is pending | A dialog is reported as open, until the request is answered, times out or is cancelled |
| The dialog was answered, cancelled or timed out; or a list request is pending | No dialog is reported as open; a list request never carries the dialog mark |
boundaryAn editor whose text is unchanged closes without a save
| Input | Outcome |
|---|---|
| Done, leaving the text box or Ctrl+Enter on an editor opened and not changed | The editor closes and no previewEditSave and no previewEditCancel is posted (a close report may follow, see SwRS-MDOKFSTUDIO-BLOCK-191) |
| Done on an insertion editor left empty | The editor closes and nothing is written |
boundaryA second final save is refused while the first is in flight
| Input | Outcome |
|---|---|
| Done, Ctrl+Enter or leaving the text box while the final save of the same editor is in flight | No second final save is posted; the editor waits for the render of the first |
Implemented in 3
Tested by 10
- test/integration/gridCardEditorBlur.test.tsintegration
- test/integration/realInput/blockKeys.tsintegration
- test/page/blockReq.requirements.test.tsunit
- test/page/modules/hostRequests.test.tsunit
- test/page/runtimeBlockEditor.test.tsunit
- test/page/runtimeBlockMoves.test.tsunit
- test/page/runtimeEditPalette.test.tsunit
- test/page/runtimeFindFromBlockEditor.test.tsunit
- test/page/runtimeGridCardEditorBlur.test.tsunit
- test/page/runtimePaletteActions.test.tsunit