Hey everyone,
Do you know how to make placeholder for editor?
Thanks
Hey everyone,
Do you know how to make placeholder for editor?
Thanks
What I’m currently doing is to subscribe to ProseMirror’s change
event (pm.on.change.add(callback)
) and then check if the content of the document is empty. If it is, I render a custom placeholder HTML element above the editor.
There was also a discussion on this topic in an old issue: https://github.com/ProseMirror/prosemirror/issues/246
Looks like this is only good solution of this problem, so in any case we have < p > element which covers < div > where it would be possible to use placeholder attribute. Thanks