Codemirror 6 / Single Line and/or avoid carriage return.

A better way to do this would be a transaction filter that forbids multiline changes. Something like…

EditorState.transactionFilter.of(tr => tr.newDoc.lines > 1 ? [] : tr)
5 Likes