🐛 Fix multiple item dragged issue
This commit is contained in:
@ -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,
|
||||
|
@ -159,7 +159,7 @@ export const ItemNodesList = ({
|
||||
/>
|
||||
)}
|
||||
|
||||
{draggedItem && (
|
||||
{draggedItem && draggedItem.blockId === block.id && (
|
||||
<Portal>
|
||||
<Flex
|
||||
pointerEvents="none"
|
||||
|
@ -31,6 +31,7 @@ export type BlockWithCreatableItems = Exclude<
|
||||
|
||||
export type DraggableItem = Exclude<ItemV6, AbTestBlock['items'][number]> & {
|
||||
type: BlockWithCreatableItems['type']
|
||||
blockId: string
|
||||
}
|
||||
|
||||
const graphDndContext = createContext<{
|
||||
|
Reference in New Issue
Block a user