Question

How can I disable mouse usage in codemirror.

I want it to behave like vim editor where the user cannot move anywhere using the mouse.

Thanks in advance.

Was it helpful?

Solution

How about using pointer-events: none; on the editor container?

.CodeMirror {
    pointer-events: none;
}

jsfiddle-icon Demo!

See also

OTHER TIPS

You can register handlers for the mouse events (mostly mousedown), and simply .preventDefault() them to prevent CodeMirror from handling them further.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top