1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 09:59:48 +02:00

Always call preventDefault() on onDrop events. (#1043)

This commit is contained in:
AlbertHilb
2017-09-05 18:26:20 +02:00
committed by Ian Storm Taylor
parent f6ca563c4d
commit 8a6024fe85

View File

@@ -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