Hi,
I am rendering a custom node that displays an input. When the node is inserted with tr.insert
, the current selection.$cursor
is automatically placed afterwards the node.
But it raises UX issues, as it displays another cursor after the caret that is in the input, deletion at the beginning of the line will remove the node instead of deleting a character in the input etc.
I’ve tried to select the newly created node, but it’s not what I want either, as typing some text will remove the node and replace it with the typed text.
Another thing I’ve tried is having a command that simply returns true
when such a node is detected in the relevant position, in order to skip other inputrules (eg for backspace). That doesn’t work because returning true
in an inputrule seems to swallow the event, so nothing is deleted in the input.
Ideally, I would like to have no selection, neither a $cursor or the current Node, so that all behaviour relying on the current selection would be disabled. Is that doable?
Perhaps I should craft a new kind of “DummySelection”?