fix: simplify collision detection to resolve iterable error
- Replaced custom collision detection with closestCenter - Removed unused imports for collision detection utilities - Fixed runtime error with collisions not being iterable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,10 +12,6 @@ import {
|
||||
DragStartEvent,
|
||||
DragOverEvent,
|
||||
DragEndEvent,
|
||||
CollisionDetection,
|
||||
rectIntersection,
|
||||
getFirstCollision,
|
||||
pointerWithin,
|
||||
} from '@dnd-kit/core'
|
||||
import {
|
||||
arrayMove,
|
||||
@@ -371,15 +367,8 @@ export function EnhancedChampionArena({ onGameModeChange, onConfigurePlayer, cla
|
||||
})
|
||||
)
|
||||
|
||||
// Custom collision detection for better drop zone detection
|
||||
const customCollisionDetection: CollisionDetection = (args) => {
|
||||
const pointerIntersections = pointerWithin(args)
|
||||
const intersections = pointerIntersections.length > 0
|
||||
? pointerIntersections
|
||||
: rectIntersection(args)
|
||||
|
||||
return getFirstCollision(intersections, 'id')
|
||||
}
|
||||
// Use closestCenter collision detection for simplicity
|
||||
const customCollisionDetection = closestCenter
|
||||
|
||||
const handleDragStart = (event: DragStartEvent) => {
|
||||
setActiveId(event.active.id as number)
|
||||
|
||||
Reference in New Issue
Block a user