docs/solutions/logic-errors/2026-05-09-inserttranspose-beforeinput-needs-model-owned-command.md
Mac Control+T can emit beforeinput with inputType: "insertTranspose".
Slate classified that as model-owned text input, prevented native DOM mutation,
then had no command to apply.
insertTranspose left abc unchanged.Represent transpose as a first-class input command:
insertTranspose to transpose-character in the editing kernelmodel-input-strategy.tsmutation-controller.tsThe command swaps the character before the cursor with the character after it. At the end of a text node, it swaps the previous two characters. Selection lands after the swapped pair.
insertTranspose is not ordinary inserted text; it carries the edit intent in
inputType, not in data. Treating every insert* event as data-backed text
means Slate can correctly prevent native mutation but still silently drop the
edit.
The clean owner is the editing kernel plus model-input strategy, not a Playground shortcut handler. That keeps browser input behavior centralized with the rest of beforeinput handling.
inputType rows with no
data payload.