We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2bc738f commit 3bd1925Copy full SHA for 3bd1925
packages/hooks/src/useLongPress/index.ts
@@ -54,7 +54,7 @@ function useLongPress(
54
};
55
56
function getClientPosition(event: EventType) {
57
- if (event instanceof TouchEvent) {
+ if ('TouchEvent' in window && event instanceof TouchEvent) {
58
return {
59
clientX: event.touches[0].clientX,
60
clientY: event.touches[0].clientY,
0 commit comments