@mocanvas/mocanvas · constant

KeyboardShiftEnterTweakExtension

declare const KeyboardShiftEnterTweakExtension: RichTextExtension & {
    kind: "keymap";
    keys: Readonly<Record<string, string>>;
}

Makes Shift+Enter insert a line break instead of splitting the block.

ProseMirror's default is the other way round, which is wrong for a canvas label: a note or a geo label is one block of text with several lines in it, not a document of paragraphs, and Enter has to commit the edit on a single-line label. Binding the break to Shift+Enter is what makes both behaviours available without a modifier key doing two jobs.

Declared as a description rather than as a live TipTap extension so importing it costs nothing; the editor factory an app registers is what turns it into a real key binding.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.