Markdown OKF-Schema Studio

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 focusLeaves towardOutcome
Mode selectA click outside the editorOne final save is run
Emoji filterOutside the frameOne final save is run
Option of a popover (holds the focus after a key)Outside the frameOne final save is run; Escape instead gives the focus back to the text box
Colour code (hex) fieldOutside the frameOne final save is run
Field of the link panelA click outside the editorThe final save is run once
Text boxA blur with no related target, or a target outside the frameThe final save is run
Control of the figure formA click outside the editor, no file dialog openThe final save is run
nominalA press on a palette control keeps the focus
Givenan open block editor
Whenthe writer presses the mouse on a palette button, on the padding of the palette bar or on an item of a popover other than a text field
Thenthe mousedown default is prevented and the text box 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 onOutcome
Emoji filter fieldNot cancelled, so the field takes the focus
URL field of the link panelNot 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 focusMoves toOutcome
Mode selectThe text boxNo save is run
Emoji filterThe text boxNo save is run
Colour code (hex) fieldA control inside the frameNo save is run
Field of the link panelAnother field of the panel or the text boxNo save is run
Control of the figure formA control inside the editor frameThe editor stays open, no save is run
Control of the figure formThe 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
Giventhe link panel open
Whenthe panel closes by Insert, Cancel, Escape or because the text box was used, whatever blur the browser fires
Thenno final save is posted by the panel, a destroyed panel ignores its later blur events, and opening then closing the panel keeps the edited text in place
nominalCmd or Ctrl with Enter finishes the edit
Focus inKeyOutcome
Mode select, changed textCmd+Enter or Ctrl+EnterThe editor is saved and closed, the final save is posted once
Mode selectEnter without a modifierThe focus returns to the text box and nothing is saved
Colour code field, changed textCmd+Enter or Ctrl+EnterThe picker closes (closePopover) and the editor is saved (onDone)
Colour code field holding a valid colourEnterThe colour is applied and the editor stays open

Implemented in 5

Tested by 4