Created
September 2, 2020 08:28
-
-
Save droid001/4a0d740e31274f065f3b622f513e2355 to your computer and use it in GitHub Desktop.
Tests the user agent for the existance of a pointer. Used to tect mobile deveices.
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
// Derived from https://stackoverflow.com/a/52854585/7197027 | |
export const hasPointer = ()=>window.matchMedia("(any-hover: none)").matches === false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment