Skip to content

Commit 1eb27d2

Browse files
authored
Merge pull request udecode#4603 from DND-IT/fix-drag-leave-logic-for-dnd
2 parents cee3d81 + 958a704 commit 1eb27d2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/neat-cooks-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@platejs/dnd': patch
3+
---
4+
5+
Fix: Drop line is not visible when hovering white space inside the editor

packages/dnd/src/DndPlugin.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ export const DndPlugin = createTPlatePlugin<DndConfig>({
9696
if (e.target instanceof Node) {
9797
const editorDOMNode = editor.api.toDOMNode(editor);
9898

99-
if (editorDOMNode && !editorDOMNode.contains(e.target)) {
99+
if (
100+
editorDOMNode &&
101+
!(e.target === editorDOMNode || editorDOMNode.contains(e.target))
102+
) {
100103
setOption('dropTarget', undefined);
101104
}
102105
}

0 commit comments

Comments
 (0)