joshfrench/react-mobiledoc-editor

Placeholder and mobiledoc prop broken

zackify opened this issue · 2 comments

https://stackblitz.com/edit/react-uhwcmq?file=src%2FApp.js

looks like the mobiledoc prop has an issue already #63

In addition it does not display a placeholder even though the docs mention this prop.

You've gotta pull in the CSS from the mobiledoc.css or make your own rule like this:

.__mobiledoc-editor{
  &.__has-no-content::after {
    content: attr(data-placeholder);
    color: #ccc;
    cursor: text;
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    line-height: 1;
  }

This is working correctly. As @geoffoliver mentioned, you need to import the underlying mobiledoc-kit css or add that snippet. See demo/index.js for working implementation.