Skip to content

Commit eef199d

Browse files
committed
fix: stop rectIntersection being used as a fallback when pointers are used
1 parent 3de2a32 commit eef199d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/ChessboardProvider.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -617,12 +617,9 @@ export function ChessboardProvider({
617617

618618
// collision detection that first tries pointer-based detection and then falls back to rectangle intersection for keyboards
619619
function collisionDetection(args: Parameters<typeof pointerWithin>[0]) {
620-
// first try pointer-based collision detection
621-
const pointerCollisions = pointerWithin(args);
622-
623-
// if we found collisions with the pointer, return those
624-
if (pointerCollisions.length > 0) {
625-
return pointerCollisions;
620+
// if a pointer is found, return those
621+
if (args.pointerCoordinates) {
622+
return pointerWithin(args);
626623
}
627624

628625
// otherwise fall back to rectangle intersection

0 commit comments

Comments
 (0)