Skip to content

Commit

Permalink
Merge pull request #2075 from stephenjason89/master
Browse files Browse the repository at this point in the history
fix: document not defined error during SSR fixes #2073
  • Loading branch information
adumesny committed Oct 12, 2022
2 parents 876fdda + 195c806 commit 5bb583b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dd-touch.ts
Expand Up @@ -10,7 +10,7 @@ import { DDManager } from './dd-manager';
* should we use this instead ? (what we had for always showing resize handles)
* /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
*/
export const isTouch: boolean = ( 'ontouchstart' in document
export const isTouch: boolean = typeof window !== 'undefined' && ( 'ontouchstart' in document
|| 'ontouchstart' in window
// || !!window.TouchEvent // true on Windows 10 Chrome desktop so don't use this
|| ((window as any).DocumentTouch && document instanceof (window as any).DocumentTouch)
Expand Down

0 comments on commit 5bb583b

Please sign in to comment.