diff --git a/shared/utils/browser.ts b/shared/utils/browser.ts index 2726cf4b1f..10c71479f0 100644 --- a/shared/utils/browser.ts +++ b/shared/utils/browser.ts @@ -20,14 +20,15 @@ export const isPWA = window.matchMedia?.("(display-mode: standalone)").matches; /** - * Returns true if the client is a touch device. Note that laptops with touch screens are - * considered touch devices, this does not neccessarily map to a small screen. + * Returns true if the client only supports touch input. + * Note that this will return false for hybrid devices which support both touch and mouse input. */ export function isTouchDevice(): boolean { if (!isBrowser) { return false; } - return window.matchMedia?.("(hover: none) and (pointer: coarse)")?.matches; + return window.matchMedia?.("(any-hover: none) and (pointer: coarse)") + ?.matches; } /**