1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-04-21 13:51:59 +02:00

fix: image disappears when the drag fails (#4631)

This commit is contained in:
zhugexinxin 2021-10-27 12:44:09 +08:00 committed by GitHub
parent 0b256b211e
commit 2ee2753d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -941,7 +941,11 @@ export const Editable = (props: EditableProps) => {
Transforms.select(editor, range)
if (state.isDraggingInternally) {
if (draggedRange) {
if (
draggedRange &&
!Range.equals(draggedRange, range) &&
!Editor.void(editor, { at: range, voids: true })
) {
Transforms.delete(editor, {
at: draggedRange,
})