fix: ignore maxTouchPoints === 256 (#493)

It can occur, that a browser on Windows 10 reports a maxTouchPoints count of 256, even though the device is a desktop system without any touch functionality at all.
See also: https://stackoverflow.com/a/67909182

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus 2021-12-30 22:22:34 +01:00 committed by GitHub
parent 5286be32b1
commit bc353a060d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,8 @@ export default class BaseMixin extends Vue {
}
get isTouchDevice() {
return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0))
// ignore if browser reports maxTouchPoints === 256, can happen on Windows 10
return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0 && navigator.maxTouchPoints !== 256))
}
get moonrakerComponents() {