diff --git a/client/src/components/rack/RackPlanner.tsx b/client/src/components/rack/RackPlanner.tsx index 119738f..f22fb61 100644 --- a/client/src/components/rack/RackPlanner.tsx +++ b/client/src/components/rack/RackPlanner.tsx @@ -69,13 +69,17 @@ function ModuleDragOverlay({ label }: { label: string }) { * (which needs the sortable rack targets) still works. */ const slotFirstCollision: CollisionDetection = (args) => { - // Restrict to slot droppables only - const slotContainers = args.droppableContainers.filter( + // droppableContainers is a custom NodeMap (not a plain Array) — it only + // implements [Symbol.iterator], so .filter() doesn't exist on it. + // Convert to Array first before filtering. + const allContainers = Array.from(args.droppableContainers); + + const slotContainers = allContainers.filter( (c) => c.data.current?.dropType === 'slot' ); if (slotContainers.length > 0) { - const slotHits = pointerWithin({ ...args, droppableContainers: slotContainers }); + const slotHits = pointerWithin({ ...args, droppableContainers: slotContainers as typeof args.droppableContainers }); if (slotHits.length > 0) return slotHits; }