From 8a6024fe85537ddeb5014c0aaec6e000a12ee931 Mon Sep 17 00:00:00 2001 From: AlbertHilb Date: Tue, 5 Sep 2017 18:26:20 +0200 Subject: [PATCH] Always call `preventDefault()` on `onDrop` events. (#1043) --- src/components/content.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/content.js b/src/components/content.js index 49de1228e..7218c87bb 100644 --- a/src/components/content.js +++ b/src/components/content.js @@ -488,11 +488,11 @@ class Content extends React.Component { */ onDrop = (event) => { + event.preventDefault() + if (this.props.readOnly) return if (!this.isInEditor(event.target)) return - event.preventDefault() - const window = getWindow(event.target) const { state, editor } = this.props const { nativeEvent } = event