facebookarchive/draft-js

Draft breaks when pressing enter on atomic block

オープン

#1,191 opened on 2017/05/04

 (4 件のコメント) (8 件のリアクション) (0 人の担当者)JavaScript (2,646 件のフォーク)batch import
documentationgood first issue

Repository metrics

Stars
 (22,554 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

What is the current behavior? When the Image is not 100% wide in the editor and you focus cursor after it and press enter you get.

invariant.js:44 Uncaught Invariant Violation: Unknown DraftEntity key.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. You can use this jsfiddle to get started: https://jsfiddle.net/stopachka/m6z0xn4r/.

In Media example remove the width styles like showed below. https://github.com/facebook/draft-js/compare/master...leniartek:patch-1 Than place the cursor after image and press enter. image

What is the expected behavior?

Enter to create a empty new line after image.

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

all draft versions all browsers

コントリビューターガイド