fix useTouchDevice query

This commit is contained in:
Brian Beck 2026-02-12 09:17:44 -08:00
parent 40724a49e6
commit 68c7b303aa
22 changed files with 25 additions and 22 deletions

View file

@ -1,6 +1,9 @@
import { useEffect, useState } from "react";
const query = "(pointer: coarse) and (hover: none)";
// Only check pointer: coarse. Adding "hover: none" would be more precise but
// Samsung Android devices incorrectly report hover: hover for touchscreens.
// See: https://www.ctrl.blog/entry/css-media-hover-samsung.html
const query = "(pointer: coarse)";
export function useTouchDevice() {
const [isTouch, setIsTouch] = useState<boolean | null>(null);