feat: treat large-screen devices as non-touch
This commit is contained in:
parent
71791c9513
commit
0d6f8789d0
1 changed files with 2 additions and 0 deletions
|
|
@ -37,6 +37,8 @@ export function isTorBrowser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isTouchDevice() {
|
export function isTouchDevice() {
|
||||||
|
// treat all large screen devices as non-touch devices
|
||||||
|
if (window.innerWidth > 768) return false
|
||||||
if (typeof window === 'undefined' || !window.navigator) return false
|
if (typeof window === 'undefined' || !window.navigator) return false
|
||||||
return 'ontouchstart' in window || navigator.maxTouchPoints > 0
|
return 'ontouchstart' in window || navigator.maxTouchPoints > 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue