Make touchscreen detection more robust
Empirically, Chrome on Android can end up not matching (hover: none), but still matching (pointer: coarse). 😕
This commit is contained in:
@@ -67,7 +67,7 @@ export function Modal({
|
|||||||
...rest
|
...rest
|
||||||
}: ModalProps) {
|
}: ModalProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const touchscreen = useMediaQuery("(hover: none)");
|
const touchscreen = useMediaQuery("(hover: none) or (pointer: coarse)");
|
||||||
const onOpenChange = useCallback(
|
const onOpenChange = useCallback(
|
||||||
(open: boolean) => {
|
(open: boolean) => {
|
||||||
if (!open) onDismiss?.();
|
if (!open) onDismiss?.();
|
||||||
|
|||||||
Reference in New Issue
Block a user