optimize dnd drag code (#3768)

This commit is contained in:
heheer
2025-02-12 15:25:31 +08:00
committed by GitHub
parent 06a8a5e23d
commit 132cf69372
6 changed files with 17 additions and 15 deletions

View File

@@ -223,8 +223,9 @@ const VariableEdit = ({
variables={variables}
/>
)}
zoom={zoom}
>
{({ provided, snapshot, draggingItemHeight }) => (
{({ provided }) => (
<Tbody {...provided.droppableProps} ref={provided.innerRef}>
{formatVariables.map((item, index) => (
<Draggable key={item.id} draggableId={item.id} index={index}>
@@ -241,7 +242,6 @@ const VariableEdit = ({
)}
</Draggable>
))}
{snapshot.isDraggingOver && <Box height={`${draggingItemHeight / zoom}px`} />}
</Tbody>
)}
</DndDrag>