facebookarchive/draft-js

Do not default to LTR for empty editors

Open

#634 opened on Sep 7, 2016

View on GitHub
 (6 comments) (0 reactions) (0 assignees)JavaScript (22,554 stars) (2,646 forks)batch import
bughelp wanted

Description

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

Reporting a bug, I guess.

What is the current behavior?

On an empty Draft.js field, the first block has a public-DraftStyleDefault-ltr class and the caret is on the left side. This is before the first character is typed. This default does not make sense for an RTL environment, where everything else is RTL except for the caret.

What is the expected behavior?

Not setting a direction when no content is available. It would default to the parent direction, which is a sensible default.

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

Draft 0.8.1, Chrome 52 and Safari 9.1.3, OS X 10.11.16. Didn’t check the older versions.


I’d be happy to work on a PR if you agree with the suggestion.

Contributor guide