Created
May 7, 2020 22:31
-
-
Save tmikeschu/f5977f74d91fbf9371559b3aa43b18d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isBrowser = typeof window !== "undefined" | |
// We check for event support via functions in case they've been mocked by a testing suite. | |
export const supportsPointerEvents = () => | |
isBrowser && window.onpointerdown === null | |
export const supportsTouchEvents = () => | |
isBrowser && window.ontouchstart === null | |
export const supportsMouseEvents = () => | |
isBrowser && window.onmousedown === null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/framer/motion/blob/cce1c12fed2fc9208bc25af81d1ca39efa0bf70f/src/events/utils.ts