mirror of
https://github.com/outline/outline.git
synced 2026-12-03 10:00:13 +03:00
fix, drag video nodes
This commit is contained in:
1 file changed
+13
@@ -344,5 +344,18 @@ function resolveTargetPos(
|
||||
}
|
||||
return { pos: $pos.before(1), isListItem: false };
|
||||
}
|
||||
|
||||
// Hovering on a top-level atom block (video, etc.) — there are no
|
||||
// positions inside an atom, so posAtCoords lands at depth 0 between
|
||||
// siblings of the doc. Pick whichever neighbouring atom block the
|
||||
// position is adjacent to.
|
||||
const after = $pos.nodeAfter;
|
||||
if (after?.isBlock && after.isAtom) {
|
||||
return { pos: $pos.pos, isListItem: false };
|
||||
}
|
||||
const before = $pos.nodeBefore;
|
||||
if (before?.isBlock && before.isAtom) {
|
||||
return { pos: $pos.pos - before.nodeSize, isListItem: false };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
Reference in new issue
Block a user