Disable Ctrl+Click

Hey @marijn, is there an easy bit of configuration to disable the Ctrl+Click behaviour of selecting the clicked node. Finding it too easy to accidentally delete content when clicking and pasting with Ctrl+V :slight_smile: If not I’m guessing this could be done somehow with handleClickOn? Any pointers would be appreciated.

I’m having this issue too, @mmason did you ever find a solution to this?

Not currently. In general, my position is still that you really want to give your users a way to select nodes, but I agree that having this baked in as unoverridable default behavior isn’t great.

You can, sort of, disable the behavior with a handleClick prop like this:

  handleClick(_view, _pos, event) {
    return /Mac/.test(navigator.platform) ? event.metaKey : event.ctrlKey
  }

I.e. handleClick is run before the ctrl-click behavior, and if you return true from it it’ll suppress that. Does that help, or would you need a way to configure or disable the feature directly?

1 Like

@marijn is this disable-able yet? If a user selects a whole node and hits backspace it can put our editor into states we never planned for. I always assumed this behavior would be disable-able.

It seems like the workaround you provided would work - but you say it only sort of works. Can you elaborate on what you mean? What issues might this approach cause?

It’ll prevent the browser’s default behavior for that click, which may or may not be what you want.

1 Like