diff --git a/packages/hooks/src/useLongPress/index.ts b/packages/hooks/src/useLongPress/index.ts index a676bcef90..caa3aee13a 100644 --- a/packages/hooks/src/useLongPress/index.ts +++ b/packages/hooks/src/useLongPress/index.ts @@ -54,7 +54,7 @@ function useLongPress( }; function getClientPosition(event: EventType) { - if (event instanceof TouchEvent) { + if ('TouchEvent' in window && event instanceof TouchEvent) { return { clientX: event.touches[0].clientX, clientY: event.touches[0].clientY,