@@ -25,7 +25,7 @@ type FormElementProps = {
25
25
} ;
26
26
27
27
export const FormElement = ( { element, index, isEditing, isDisabled } : FormElementProps ) => {
28
- const { attributes, listeners, setNodeRef, transform, transition } = useSortable ( {
28
+ const { attributes, listeners, isDragging , setNodeRef, transform, transition } = useSortable ( {
29
29
id : element . id ,
30
30
disabled : isDisabled ,
31
31
} ) ;
@@ -78,7 +78,8 @@ export const FormElement = ({ element, index, isEditing, isDisabled }: FormEleme
78
78
"group flex min-h-[76px] flex-1 flex-shrink-0 items-center justify-between gap-3 self-stretch rounded border border-l-[12px] border-solid border-gray-200 border-l-emerald-100 bg-white p-3 pr-4" ,
79
79
isEditing && "border-sky-500 border-l-blue-500" ,
80
80
isDisabled && "cursor-auto opacity-50" ,
81
- element . deleted && "border-l-red-200"
81
+ element . deleted && "border-l-red-200" ,
82
+ isDragging && "z-10 cursor-grabbing"
82
83
) }
83
84
>
84
85
< div className = "flex flex-1 flex-shrink-0 flex-wrap justify-start gap-0.5" >
@@ -110,7 +111,10 @@ export const FormElement = ({ element, index, isEditing, isDisabled }: FormEleme
110
111
aria-label = "Drag handle"
111
112
disabled = { isDisabled || element . deleted }
112
113
variant = "ghost"
113
- className = "p-1.5 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100"
114
+ className = { cn (
115
+ "p-1.5 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100" ,
116
+ isDragging ? "cursor-grabbing" : "cursor-grab"
117
+ ) }
114
118
{ ...listeners }
115
119
{ ...attributes }
116
120
tabIndex = { 0 }
0 commit comments