Fix module drag-and-drop: replace useDroppable/collision with elementFromPoint
Completely removes dnd-kit's useDroppable and collision detection for rack slot targeting. Uses onDragMove + document.elementFromPoint() with data-rack-id / data-u-pos HTML attributes on RackSlot elements to resolve the hovered slot independently of dnd-kit's SortableContext interference. Adds pointer-events-none to ModuleBlock when isDragging so the invisible element doesn't block hit testing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -119,7 +119,7 @@ export function ModuleBlock({ module }: ModuleBlockProps) {
|
||||
'relative w-full border-l-4 select-none overflow-hidden transition-opacity',
|
||||
colors.bg,
|
||||
colors.border,
|
||||
isDragging ? 'opacity-0' : 'cursor-grab active:cursor-grabbing',
|
||||
isDragging ? 'opacity-0 pointer-events-none' : 'cursor-grab active:cursor-grabbing',
|
||||
!isDragging && hovered && 'brightness-110',
|
||||
previewUSize !== null && 'ring-1 ring-white/30'
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user