Read only support in Mobile Safari

Currently, when I set readOnly on a codemirror instance, that editor still brings up the keyboard in iOS. In another thread, a workaround of setting readOnly to “nocursor” is suggested as the only real way to prevent this, but in my testing when I set “nocursor” I still get a keyboard (and a cursor) in Mobile Safari. Is anyone else seeing this behavior? Just trying to narrow down if this problem is specific to me or not.

Good point. The contentEditable input for mobile wasn’t handling the readOnly option. This patch should help.

This does work, thanks. It’s unfortunate that this blocks the ability to copy/paste in iOS though. It’s certainly possible to select/copy without bringing up a keyboard in Mobile Safari.

It does that on desktop browsers as well. Have you tried setting readOnly to true instead of "nocursor"?

Yes, I set it to true already. I was exploring “readonly” as a solution to iOS bringing up the software keyboard on readonly fields.