CodeMirror read only mode

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?

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

I have something like that already:

1 Like

This did not work for me.

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.

1 Like