Draft-js: overview example not working

Created on 25 Sep 2018  路  4Comments  路  Source: facebook/draft-js

Do you want to request a feature or report a bug? bug

What is the current behavior?
The overview docs give sample code to get started, but when trying out the example the code does not work. There is no error, nothing to go by.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem: https://codesandbox.io/s/m047pmjv9

What is the expected behavior? the code sample in the docs should work. Also maybe use what react docs has like a live editor to try out sample code snippets

Which versions of Draft.js, and which browser / OS are affected by this issue? Did this work in previous versions of Draft.js? chrome canary 71.0

documentation

All 4 comments

The link you included was working for me. I made a few small changes to highlight some things:

  • I added a border around the editor and gave it a minimum height, so you could see it more clearly
  • I added a handler for focus, so that you could click anywhere in the editor and it would focus on it

Let me know if it works

https://codesandbox.io/s/q97v24x41q

How can I get the editor to show all the options for the rich text editing? Not seeing that.

Thanks for help 馃憤

One of the examples in the repository is for rich text editing.

I had trouble getting setup when I first started. I ended up following the steps in the Examples section in Github. After you complete the steps, you open this file in a browser (I used Chrome). You should see the editor with a few rich text editing options.

Let me know if that works.

Thanks for reporting this, @hozefaj! I agree it may be confusing if you don't know the editor is frameless and spans only a line, unless you enclose it in a container.

I'll look into this and update the overview demo.

Was this page helpful?
0 / 5 - 0 ratings