1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-15 19:54:02 +02:00

Don't stop propagation of drop event (#1716)

Summary:

We mirrored the fix in PR #1278 (meant for #1277) but for drop event.
This fixed an issue I faced with Slate swallowing drop event, kind of breaking compatibility with react-dnd.

/cc @AlbertHilb
This commit is contained in:
Stan Chang Khin Boon
2018-03-23 05:22:57 +08:00
committed by Ian Storm Taylor
parent 3fe60f3795
commit bff3d34a2d
2 changed files with 3 additions and 5 deletions

View File

@@ -317,14 +317,15 @@ class Content extends React.Component {
}
}
// Don't handle drag events coming from embedded editors.
// Don't handle drag and drop events coming from embedded editors.
if (
handler == 'onDragEnd' ||
handler == 'onDragEnter' ||
handler == 'onDragExit' ||
handler == 'onDragLeave' ||
handler == 'onDragOver' ||
handler == 'onDragStart'
handler == 'onDragStart' ||
handler == 'onDrop'
) {
const { target } = event
const targetEditorNode = target.closest('[data-slate-editor]')

View File

@@ -301,9 +301,6 @@ function BeforePlugin() {
*/
function onDrop(event, change, editor) {
// Stop propagation so the event isn't visible to parent editors.
event.stopPropagation()
// Nothing happens in read-only mode.
if (editor.props.readOnly) return true