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:
2026-03-22 08:41:03 -05:00
parent d381f8b720
commit c9aed96400
4 changed files with 109 additions and 60 deletions

View File

@@ -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'
)}