Show caret on readonly mode

Thanks for this amazing editor !

I want to prevent Android/IOS system keyboards from displaying while using the editor on mobile (i want to use my own visual keyboard).

The only way i found is to use the editor in a readonly mode and i have some questions :

  • Is it possible to have the editing caret displayed in readonly mode?
  • Is it possible to manage selection in readonly mode ?
  • Is it possible to apply marks (bold, italic…) on a selection in readonly mode ?

Do you have other ideas about how to not show the mobile os keyboard ?

Thanks again.

(This sounds like a rather bad idea for various reasons—accessibility, generally violating expected behavior, missing features in your custom solution, etc)

readonly mode sets contenteditable to false, which causes browsers to not show a cursor.

The editor does that to certain degree—it will notice range selections on the content and update its state.selection accordingly.

Yes, that should work.

Thanks for the fast reply,

On a readonly mode, do you think that i can display a blinking cursor and move it programatically using marks/nodes/…etc ? (just to give the impression that the user is editing)

You should be able to use a widget decoration to do that.

Thanks @marijn , I managed to show a visual cursor on the readonly editor using widget decoration.

My question now is how can I insert text from my visual keyboard at a given position on the editor, how can i remove text at a given position as well ?

Look into the Transaction (and its superclass Transform) interface.

@marijn handleClick plugin’s prop is not firing on mobile, any ideas ?

Thanks.