🐛 Fix multiple item dragged issue
This commit is contained in:
@ -59,7 +59,7 @@ export const ItemNode = ({
|
|||||||
)
|
)
|
||||||
const onDrag = (position: NodePosition) => {
|
const onDrag = (position: NodePosition) => {
|
||||||
if (!onMouseDown || block.type === LogicBlockType.AB_TEST) return
|
if (!onMouseDown || block.type === LogicBlockType.AB_TEST) return
|
||||||
onMouseDown(position, { ...item, type: block.type })
|
onMouseDown(position, { ...item, type: block.type, blockId: block.id })
|
||||||
}
|
}
|
||||||
useDragDistance({
|
useDragDistance({
|
||||||
ref: itemRef,
|
ref: itemRef,
|
||||||
|
@ -159,7 +159,7 @@ export const ItemNodesList = ({
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{draggedItem && (
|
{draggedItem && draggedItem.blockId === block.id && (
|
||||||
<Portal>
|
<Portal>
|
||||||
<Flex
|
<Flex
|
||||||
pointerEvents="none"
|
pointerEvents="none"
|
||||||
|
@ -31,6 +31,7 @@ export type BlockWithCreatableItems = Exclude<
|
|||||||
|
|
||||||
export type DraggableItem = Exclude<ItemV6, AbTestBlock['items'][number]> & {
|
export type DraggableItem = Exclude<ItemV6, AbTestBlock['items'][number]> & {
|
||||||
type: BlockWithCreatableItems['type']
|
type: BlockWithCreatableItems['type']
|
||||||
|
blockId: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const graphDndContext = createContext<{
|
const graphDndContext = createContext<{
|
||||||
|
Reference in New Issue
Block a user