OS-level spellcheck is disabled on iOS even after adding `contentAttribute`

I’ve noticed that in CM6 the OS-level spellcheck is disabled.

On Chrome/Safari on macOS though, I can use contentAttributes to add this behavior back in, e.g. with:

EditorView.contentAttributes.of({ spellcheck: 'true' }),

And then any misspelled words are highlighted and I can context-click to correct it using the OSes built-in spellcheck functionality.

However on iOS this doesn’t work at all – misspelled words continue to just be ignored. This is fairly strange because I think by default iOS tries to check for correct spelling everywhere, so it must be being disabled somewhere.

Is this deliberate? Is there an obvious way to fix this so that mobile/desktop behave in the same way and spellcheck again?


This is a limitation in Safari – when the editable DOM is changed programmatically, which it usually is in CodeMirror due to syntax highlighting and such, it won’t spell-check it.

Gotcha – guess there isn’t any way around this in userland then / anything hacky I can do?

ProseMirror sorta kludges around this by trying its best not to touch the DOM unless necessary, but in an editor like CodeMirror that would be difficult. I’m not aware of any other solutions.