Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Fix nested sheets opening behind mobile modals

Cursor Agentc250a387ac03
diff --git a/packages/ui/src/sheet.tsx b/packages/ui/src/sheet.tsx
index 2cf5bae27b..27c95b6600 100644
--- a/packages/ui/src/sheet.tsx
+++ b/packages/ui/src/sheet.tsx
@@ -13,11 +13,14 @@ function SheetRoot({
typeof Drawer.Root
>) {
const RootComponent = nested ? Drawer.NestedRoot : Drawer.Root;
+ // Nested sheets (e.g. create reward from the mobile edit-reward modal) must
+ // stack above Modal's mobile Drawer (z-50). Standalone sheets stay at z-40.
+ const zIndexClassName = nested ? "z-[60]" : "z-40";
return (
<RootComponent direction="right" handleOnly {...rest}>
<Drawer.Portal>
<Drawer.Overlay
- className="fixed inset-0 z-40 bg-black/20"
+ className={cn("fixed inset-0 bg-black/20", zIndexClassName)}
data-sheet-overlay
/>
<Drawer.Content
@@ -33,7 +36,8 @@ function SheetRoot({
contentProps?.onPointerDownOutside?.(e);
}}
className={cn(
- "@container/sheet fixed bottom-2 right-2 top-2 z-40 flex outline-none",
+ "@container/sheet fixed bottom-2 right-2 top-2 flex outline-none",
+ zIndexClassName,
"w-[min(var(--sheet-width),calc(100%-2*var(--sheet-margin)))] [--sheet-margin:8px] [--sheet-width:540px]",
contentProps?.className,
)}