ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.61k stars 336 forks source link

Unable to add content before an inline node at the start of the codument #1343

Closed amcgowan-tophat closed 1 year ago

amcgowan-tophat commented 1 year ago

We have an inline node that behaves like an input field that can be placed anywhere within a paragraph. If this node is placed at the beginning of an empty line, you cannot add content before the node. We are using Gapcursor, however our nodes are excluded as the parent is a text block - https://github.com/ProseMirror/prosemirror-gapcursor/blob/adc339bc34678f6d4f4250d5bc186dbaeda0c0c0/src/gapcursor.ts#L40 (parent.isTextblock is true, so gapcursor is not valid here)

Code sandbox here to repro https://codesandbox.io/s/silly-ace-gqesdb?file=/src/App.js - You cannot add content before either of the inline nodes at the start of a paragraph.

marijnh commented 1 year ago

Indeed, inline nodes with content are not something ProseMirror provides any kind of user interface for. You can define them, but you'll have to script your own behavior for them.