Skip to content

How to unify confusing behavior of shift+enter vs just enter? #4464

Closed Answered by MTRNord
MTRNord asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like this does the trick. Copied from the richtext plugin :)

editor.registerCommand<KeyboardEvent | null>(
            KEY_ENTER_COMMAND,
            (event) => {
                const selection = $getSelection();
                if (!$isRangeSelection(selection)) {
                    return false;
                }
                if (event !== null) {
                    // If we have beforeinput, then we can avoid blocking
                    // the default behavior. This ensures that the iOS can
                    // intercept that we're actually inserting a paragraph,
                    // and autocomplete, autocapitalize etc work as intended.
                    // This can…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Dan86de
Comment options

Answer selected by MTRNord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants