fix(sheet): native scroll container so vaul drag detection works

This commit is contained in:
2026-08-25 22:59:00 -07:00
parent e4d1ba720a
commit c05bdec252
+12 -7
View File
@@ -9,7 +9,7 @@ import {
import { useIsMobile } from "@/hooks/use-is-mobile";
import Drawer from "./drawer";
import Modal from "./modal";
import { ScrollArea, Flex, Loader } from "@mantine/core";
import { Box, Flex, Loader } from "@mantine/core";
interface SheetProps extends PropsWithChildren {
title?: string;
@@ -60,14 +60,19 @@ const Sheet: React.FC<SheetProps> = ({ title, children, opened, onChange }) => {
<Loader size='lg' />
</Flex>
}>
<ScrollArea.Autosize
style={{ flex: 1, maxHeight: '75dvh' }}
scrollbarSize={8}
scrollbars="y"
type="scroll"
{/* Native overflow, not ScrollArea: vaul's drag-vs-scroll detection
only recognizes natively scrollable elements. */}
<Box
style={{
flex: 1,
maxHeight: "75dvh",
overflowY: "auto",
overscrollBehavior: "contain",
WebkitOverflowScrolling: "touch",
}}
>
{children}
</ScrollArea.Autosize>
</Box>
</Suspense>
</SheetComponent>
);