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

fix to prevent being able to drag text into a void

This commit is contained in:
Ian Storm Taylor
2016-07-22 17:04:16 -07:00
parent 8543a63526
commit 42f4aa629c

View File

@@ -320,6 +320,9 @@ class Content extends React.Component {
isFocused: true isFocused: true
}) })
// If the target is inside a void node, abort.
if (state.document.hasVoidParent(point.key)) return
// If the drag is internal, handle it now. And it the target is after the // If the drag is internal, handle it now. And it the target is after the
// selection, it needs to account for the selection's content being deleted. // selection, it needs to account for the selection's content being deleted.
if (this.tmp.isInternalDrag) { if (this.tmp.isInternalDrag) {