Skip to content

Commit ed00a07

Browse files
committed
more SSR isTouch fixes
1 parent 5bb583b commit ed00a07

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dd-touch.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { DDManager } from './dd-manager';
1010
* should we use this instead ? (what we had for always showing resize handles)
1111
* /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
1212
*/
13-
export const isTouch: boolean = typeof window !== 'undefined' && ( 'ontouchstart' in document
13+
export const isTouch: boolean = typeof window !== 'undefined' && typeof document !== 'undefined' &&
14+
( 'ontouchstart' in document
1415
|| 'ontouchstart' in window
1516
// || !!window.TouchEvent // true on Windows 10 Chrome desktop so don't use this
1617
|| ((window as any).DocumentTouch && document instanceof (window as any).DocumentTouch)

0 commit comments

Comments
 (0)