mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-22 12:36:24 +08:00
feat(core): dnd support external types (#9033)
fix AF-1847 two issues: 1. original `dropTargetForExternal` only works if dragging target is from another window context. patched the library to bypass this issue 2. `dataTransfer`'s content is only available on `drop` event. This means we cannot have `canDrop` checks for external elements (like blocksuite links).
This commit is contained in:
@@ -103,6 +103,8 @@ export const useDraggable = <D extends DNDData = DNDData>(
|
||||
},
|
||||
};
|
||||
|
||||
dragRef.current.dataset.affineDraggable = 'true';
|
||||
|
||||
const cleanupDraggable = draggable({
|
||||
element: dragRef.current,
|
||||
dragHandle: dragHandleRef.current ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user