Don't type over NodeSelection

This was going to be a question, but I found a decent way to do it with the handleTextInput option, so I’m just sharing:

import {NodeSelection} from 'prosemirror-state'

        // Don't type over node selection
        handleTextInput: function (view, from, to, text) {
          if (view.state.selection instanceof NodeSelection) {
            return true
          }
        },
1 Like