mirror of
https://github.com/exogen/t2-mapper.git
synced 2026-07-11 14:34:51 +00:00
fix useTouchDevice query
This commit is contained in:
parent
40724a49e6
commit
68c7b303aa
22 changed files with 25 additions and 22 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue