Placeholder feature

Hey everyone,

Do you know how to make placeholder for editor?

Thanks

1 Like

@aiserg I’m not sure what you mean by “placeholder”. Could you elaborate a bit?

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