facebookarchive/draft-js

Do not default to LTR for empty editors

Open

#634 创建于 2016年9月7日

在 GitHub 查看
 (6 评论) (0 反应) (0 负责人)JavaScript (22,554 star) (2,646 fork)batch import
bughelp wanted

描述

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.

贡献者指南