Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

overview example not working #1880

Closed
hozefaj opened this issue Sep 25, 2018 · 4 comments
Closed

overview example not working #1880

hozefaj opened this issue Sep 25, 2018 · 4 comments
Assignees

Comments

@hozefaj
Copy link

hozefaj commented Sep 25, 2018

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

@cojennin
Copy link

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

@hozefaj
Copy link
Author

hozefaj commented Oct 1, 2018

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

Thanks for help 👍

@cojennin
Copy link

cojennin commented Oct 1, 2018

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.

@claudiopro claudiopro self-assigned this Oct 4, 2018
@claudiopro
Copy link
Contributor

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.

jdecked pushed a commit to twitter-forks/draft-js that referenced this issue Oct 9, 2019
…archive#1887)

Summary:
**Summary**

Improves editor overview example providing a code sample that sets the editor's min height and border, as well as focuses the editor when clicking the editor area.

**Test Plan**

Copy and paste example into CodeSandbox
https://codesandbox.io/s/9y5162ryj4

Fixes facebookarchive#1880
Pull Request resolved: facebookarchive#1887

Differential Revision: D10200611

fbshipit-source-id: 5c261cf78d8d36e3255528b68d30d7b46e2908bf
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants