🐛 (editor) Fix condition item drag and drop
This commit is contained in:
@ -1,26 +0,0 @@
|
||||
import { Flex, FlexProps, useColorModeValue } from '@chakra-ui/react'
|
||||
import { Item } from 'models'
|
||||
import React, { ReactNode } from 'react'
|
||||
|
||||
type Props = {
|
||||
item: Item
|
||||
} & FlexProps
|
||||
|
||||
export const ItemNodeOverlay = ({ item, ...props }: Props) => {
|
||||
return (
|
||||
<Flex
|
||||
px="4"
|
||||
py="2"
|
||||
rounded="md"
|
||||
bgColor={useColorModeValue('white', 'gray.850')}
|
||||
borderWidth="1px"
|
||||
borderColor={useColorModeValue('gray.200', 'gray.700')}
|
||||
w="212px"
|
||||
pointerEvents="none"
|
||||
shadow="lg"
|
||||
{...props}
|
||||
>
|
||||
{(item.content ?? 'Click to edit') as ReactNode}
|
||||
</Flex>
|
||||
)
|
||||
}
|
@ -17,7 +17,6 @@ import { BlockIndices, BlockWithItems, LogicBlockType, Item } from 'models'
|
||||
import React, { useEffect, useRef, useState } from 'react'
|
||||
import { ItemNode } from './ItemNode'
|
||||
import { SourceEndpoint } from '../../Endpoints'
|
||||
import { ItemNodeOverlay } from './ItemNodeOverlay'
|
||||
import { PlaceholderNode } from '../PlaceholderNode'
|
||||
|
||||
type Props = {
|
||||
@ -164,7 +163,11 @@ export const ItemNodesList = ({
|
||||
w="220px"
|
||||
transformOrigin="0 0 0"
|
||||
>
|
||||
<ItemNodeOverlay item={draggedItem} />
|
||||
<ItemNode
|
||||
item={draggedItem}
|
||||
indices={{ groupIndex, blockIndex, itemIndex: 0 }}
|
||||
connectionDisabled
|
||||
/>
|
||||
</Flex>
|
||||
</Portal>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user