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