Fix drawer option
This commit is contained in:
+6
-1
@@ -80,7 +80,7 @@ export const Modal: FC<Props> = ({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
// Empirically, Chrome on Android can end up not matching (hover: none), but
|
// Empirically, Chrome on Android can end up not matching (hover: none), but
|
||||||
// still matching (pointer: coarse) :/
|
// still matching (pointer: coarse) :/
|
||||||
const touchscreen = useMediaQuery("(hover: none) or (pointer: coarse)");
|
const touchscreen = true; //useMediaQuery("(hover: none) or (pointer: coarse)");
|
||||||
const onOpenChange = useCallback(
|
const onOpenChange = useCallback(
|
||||||
(open: boolean) => {
|
(open: boolean) => {
|
||||||
if (!open) onDismiss?.();
|
if (!open) onDismiss?.();
|
||||||
@@ -92,6 +92,11 @@ export const Modal: FC<Props> = ({
|
|||||||
return (
|
return (
|
||||||
<Drawer.Root
|
<Drawer.Root
|
||||||
open={open}
|
open={open}
|
||||||
|
// This autofocus is a custom vault property and not the
|
||||||
|
// standard HTML autofocus attribute.
|
||||||
|
// It makes the Drawer.Root behave like the `DialogRoot`
|
||||||
|
// eslint-disable-next-line jsx-a11y/no-autofocus
|
||||||
|
autoFocus
|
||||||
onOpenChange={onOpenChange}
|
onOpenChange={onOpenChange}
|
||||||
dismissible={onDismiss !== undefined}
|
dismissible={onDismiss !== undefined}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user