@@ -191,22 +191,28 @@ interface SortableOverlayProps
191191 activeId ?: UniqueIdentifier | null
192192}
193193
194- function SortableOverlay ( {
195- activeId,
196- dropAnimation = dropAnimationOpts ,
197- children,
198- ...props
199- } : SortableOverlayProps ) {
200- return (
201- < DragOverlay dropAnimation = { dropAnimation } { ...props } >
202- { activeId ? (
203- < SortableItem value = { activeId } asChild >
204- { children }
205- </ SortableItem >
206- ) : null }
207- </ DragOverlay >
208- )
209- }
194+ const SortableOverlay = React . forwardRef < HTMLDivElement , SortableOverlayProps > (
195+ (
196+ { activeId, dropAnimation = dropAnimationOpts , children, ...props } ,
197+ ref
198+ ) => {
199+ return (
200+ < DragOverlay dropAnimation = { dropAnimation } { ...props } >
201+ { activeId ? (
202+ < SortableItem
203+ ref = { ref }
204+ value = { activeId }
205+ className = "cursor-grabbing"
206+ asChild
207+ >
208+ { children }
209+ </ SortableItem >
210+ ) : null }
211+ </ DragOverlay >
212+ )
213+ }
214+ )
215+ SortableOverlay . displayName = "SortableOverlay"
210216
211217interface SortableItemContextProps {
212218 attributes : React . HTMLAttributes < HTMLElement >
@@ -273,7 +279,7 @@ const SortableItem = React.forwardRef<HTMLDivElement, SortableItemProps>(
273279 [ attributes , listeners , isDragging ]
274280 )
275281 const style : React . CSSProperties = {
276- opacity : isDragging ? 0.4 : undefined ,
282+ opacity : isDragging ? 0.5 : 1 ,
277283 transform : CSS . Translate . toString ( transform ) ,
278284 transition,
279285 }
@@ -284,7 +290,11 @@ const SortableItem = React.forwardRef<HTMLDivElement, SortableItemProps>(
284290 < SortableItemContext . Provider value = { context } >
285291 < Comp
286292 data-state = { isDragging ? "dragging" : undefined }
287- className = { cn ( "data-[state=dragging]:cursor-grabbing" , className ) }
293+ className = { cn (
294+ "data-[state=dragging]:cursor-grabbing" ,
295+ { "cursor-grab" : ! isDragging && asTrigger } ,
296+ className
297+ ) }
288298 ref = { composeRefs ( ref , setNodeRef as React . Ref < HTMLDivElement > ) }
289299 style = { style }
290300 { ...( asTrigger ? attributes : { } ) }
0 commit comments