2
0

🐛 Fix multiple item dragged issue

This commit is contained in:
Baptiste Arnaud
2023-12-05 08:22:46 +01:00
parent cb87a72cca
commit a43d047f60
3 changed files with 3 additions and 2 deletions

View File

@ -59,7 +59,7 @@ export const ItemNode = ({
)
const onDrag = (position: NodePosition) => {
if (!onMouseDown || block.type === LogicBlockType.AB_TEST) return
onMouseDown(position, { ...item, type: block.type })
onMouseDown(position, { ...item, type: block.type, blockId: block.id })
}
useDragDistance({
ref: itemRef,

View File

@ -159,7 +159,7 @@ export const ItemNodesList = ({
/>
)}
{draggedItem && (
{draggedItem && draggedItem.blockId === block.id && (
<Portal>
<Flex
pointerEvents="none"

View File

@ -31,6 +31,7 @@ export type BlockWithCreatableItems = Exclude<
export type DraggableItem = Exclude<ItemV6, AbTestBlock['items'][number]> & {
type: BlockWithCreatableItems['type']
blockId: string
}
const graphDndContext = createContext<{