mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-09 00:36:41 +02:00
fix: image disappears when the drag fails (#4631)
This commit is contained in:
@@ -941,7 +941,11 @@ export const Editable = (props: EditableProps) => {
|
|||||||
Transforms.select(editor, range)
|
Transforms.select(editor, range)
|
||||||
|
|
||||||
if (state.isDraggingInternally) {
|
if (state.isDraggingInternally) {
|
||||||
if (draggedRange) {
|
if (
|
||||||
|
draggedRange &&
|
||||||
|
!Range.equals(draggedRange, range) &&
|
||||||
|
!Editor.void(editor, { at: range, voids: true })
|
||||||
|
) {
|
||||||
Transforms.delete(editor, {
|
Transforms.delete(editor, {
|
||||||
at: draggedRange,
|
at: draggedRange,
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user