Behaviour SwRS-MDOKFSTUDIO-PALETTE-036
Leaving the frame from a palette control saves once and a press keeps the text box focus
When the writer presses the mouse on a palette control or the focus leaves one, the extension SHALL cancel a press that is not on a text field so that the text box keeps the focus, and run the normal final save once only when the focus goes outside the editor frame.
Part of StRS-MDOKFSTUDIO-PALETTE-002, outside the paths drawn on its map.
Step 2 of path 1 in StRS-MDOKFSTUDIO-PALETTE-005: from “The palette is in view above the text box” to “The editor is open with the focus in the text”.
Part of StRS-MDOKFSTUDIO-PALETTE-007, outside the paths drawn on its map.
Scenarios 6
The situations the tests check; open one to read it.
nominalLeaving the frame from a palette control
One row per control. The same rule holds for each: a blur toward no target or a target outside the editor frame runs the final save once.
| Control holding the focus | Leaves toward | Outcome |
|---|---|---|
| Mode select | A click outside the editor | One final save is run |
| Emoji filter | Outside the frame | One final save is run |
| Option of a popover (holds the focus after a key) | Outside the frame | One final save is run; Escape instead gives the focus back to the text box |
| Colour code (hex) field | Outside the frame | One final save is run |
| Field of the link panel | A click outside the editor | The final save is run once |
| Text box | A blur with no related target, or a target outside the frame | The final save is run |
| Control of the figure form | A click outside the editor, no file dialog open | The final save is run |
nominalA press on a palette control keeps the focus
The link panel follows the same rule: a press on its padding or on the Insert button is cancelled and the focus stays in Text.
boundaryA press on a text field is not cancelled
| Press on | Outcome |
|---|---|
| Emoji filter field | Not cancelled, so the field takes the focus |
| URL field of the link panel | Not cancelled, the URL field takes the focus (only a mousedown on an INPUT element is left alone) |
refusalMoving inside the frame does not save
| Control holding the focus | Moves to | Outcome |
|---|---|---|
| Mode select | The text box | No save is run |
| Emoji filter | The text box | No save is run |
| Colour code (hex) field | A control inside the frame | No save is run |
| Field of the link panel | Another field of the panel or the text box | No save is run |
| Control of the figure form | A control inside the editor frame | The editor stays open, no save is run |
| Control of the figure form | The Browse file dialog (a host dialog is open) | No save is posted: a blur while a host dialog is open is ignored |
refusalClosing the link panel never produces a save
nominalCmd or Ctrl with Enter finishes the edit
| Focus in | Key | Outcome |
|---|---|---|
| Mode select, changed text | Cmd+Enter or Ctrl+Enter | The editor is saved and closed, the final save is posted once |
| Mode select | Enter without a modifier | The focus returns to the text box and nothing is saved |
| Colour code field, changed text | Cmd+Enter or Ctrl+Enter | The picker closes (closePopover) and the editor is saved (onDone) |
| Colour code field holding a valid colour | Enter | The colour is applied and the editor stays open |