From 09134035a83e3d1ef2a43429ea6799243a8b6f0a Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Tue, 29 Sep 2026 13:26:55 +0200 Subject: [PATCH] fix(ui): let a mouse press click inside a bottom sheet The drawer took a mouse press anywhere outside Drawer.Content as the start of a swipe and captured the pointer, so switches and buttons in a bottom sheet never received the click. The sheet's children now sit in Drawer.Content; touch swipes still dismiss from anywhere. --- packages/ui/src/components/sheet.test.tsx | 7 +++++-- packages/ui/src/components/sheet.tsx | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/components/sheet.test.tsx b/packages/ui/src/components/sheet.test.tsx index f41217471..e6e71443e 100644 --- a/packages/ui/src/components/sheet.test.tsx +++ b/packages/ui/src/components/sheet.test.tsx @@ -30,7 +30,7 @@ describe("Sheet", () => { visible , ); - const content = screen.getByText("visible"); + const content = screen.getByText("visible").closest('[data-slot="sheet-content"]'); expect(content).toHaveAttribute("data-side", "right"); }); @@ -41,7 +41,10 @@ describe("Sheet", () => { visible {side} , ); - expect(screen.getByText(`visible ${side}`)).toHaveAttribute("data-side", side); + expect(screen.getByText(`visible ${side}`).closest('[data-slot="sheet-content"]')).toHaveAttribute( + "data-side", + side, + ); }); it("renders close button by default", () => { diff --git a/packages/ui/src/components/sheet.tsx b/packages/ui/src/components/sheet.tsx index c4e11dab6..7a61c997f 100644 --- a/packages/ui/src/components/sheet.tsx +++ b/packages/ui/src/components/sheet.tsx @@ -74,7 +74,8 @@ function SheetContent({ {side === "bottom" && (