سؤال

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.

هل كانت مفيدة؟

المحلول

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

.CodeMirror {
    pointer-events: none;
}

jsfiddle-icon Demo!

See also

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top