- Issue #1725 has been merged to master branch
- New version with this issue fixed has been release to npm server
Use npm run start
to run the demo. Then do following steps:
-
Type in anything, you should see draft-js in "edit" mode
By saying "edit" mode, it means
this.setMode('edit')
indraft-js/src/component/base/DraftEditor.react.js
-
Press "enter" to confirm it's in "edit" mode.
handleReturn
is defined insrc/App.js
in this project. Thus, when it's in "edit" mode, press "enter" will not create newline, but you should see "Enter pressed." in console. -
Drag any file and drop it in draft-js.
You should see "Dropped." in console. (Defined in
src/App.js
usinghandleDroppedFiles
attribute)At this moment,
this._dragCount
should be positive number (defined indraft-js/src/component/base/DraftEditor.react.js
), asonDragEnter
increase this number, but there is noonDragLeave
triggered thus this number is never decreased back to 0. -
Drag any file onto draft-js, do NOT drop it, and leave.
Since
this._dragCount
is still positive number indraft-js/src/component/base/DraftEditor.react.js
,this.exitCurrentMode()
is not triggered whenonDragLeave
called. Thus it remains in "drag" mode. -
Press "enter" to confirm it's NOT in "edit" mode.
You should see newline generated, and nothing output in console.
This should be an issue still available in Draft.js v.0.10.5