Fix dnd on Options->Fields dropdown. (#1921)

fix dnd
This commit is contained in:
Tom Avalexing 2023-10-10 17:25:06 +03:00 committed by GitHub
parent 04091a4ce0
commit 6a3002ddf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
import { useState } from 'react';
import styled from '@emotion/styled';
import {
DragDropContext,
@ -5,7 +6,6 @@ import {
OnDragEndResponder,
} from '@hello-pangea/dnd';
import { v4 } from 'uuid';
type DraggableListProps = {
draggableItems: React.ReactNode;
onDragEnd: OnDragEndResponder;
@ -19,10 +19,12 @@ export const DraggableList = ({
draggableItems,
onDragEnd,
}: DraggableListProps) => {
const [v4Persistable] = useState(v4());
return (
<DragDropContext onDragEnd={onDragEnd}>
<StyledDragDropItemsWrapper>
<Droppable droppableId={v4()}>
<Droppable droppableId={v4Persistable}>
{(provided) => (
<div ref={provided.innerRef} {...provided.droppableProps}>
{draggableItems}