Skip to content

Commit 5e7a5af

Browse files
authored
fix: useMove broken by NODE_ENV check (#8046)
1 parent cce6f16 commit 5e7a5af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/@react-aria/interactions/src/useMove.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export function useMove(props: MoveEvents): MoveResult {
9393
state.current.didMove = false;
9494
};
9595

96-
if (typeof PointerEvent === 'undefined') {
96+
if (typeof PointerEvent === 'undefined' && process.env.NODE_ENV === 'test') {
9797
let onMouseMove = (e: MouseEvent) => {
9898
if (e.button === 0) {
9999
move(e, 'mouse', e.pageX - (state.current.lastPosition?.pageX ?? 0), e.pageY - (state.current.lastPosition?.pageY ?? 0));
@@ -151,7 +151,7 @@ export function useMove(props: MoveEvents): MoveResult {
151151
addGlobalListener(window, 'touchend', onTouchEnd, false);
152152
addGlobalListener(window, 'touchcancel', onTouchEnd, false);
153153
};
154-
} else if (process.env.NODE_ENV === 'test') {
154+
} else {
155155
let onPointerMove = (e: PointerEvent) => {
156156
if (e.pointerId === state.current.id) {
157157
let pointerType = (e.pointerType || 'mouse') as PointerType;

0 commit comments

Comments
 (0)