CodeMirror read only mode


#1

I am using CodeMirror for YAML.

I am making my editor readOnly using ‘readOnly: true’ option.
But visually, the editor does not look to be readOnly.

Is there also a way to blur the editor while in readOnly mode so that it appears to be readOnly and user need not click inside the editor to understand that it is not editable?


#2

You’ll have to do that with your own styling.


#3

I have something like that already:


#4

This did not work for me.


#5

Ah, it’s probably because I forgot to give you the other half of the code I wrote:

In particular, I set a readOnly class in the options.