Skip to content

Commit f2d356d

Browse files
fix(sidebar): remove z-50 from mobile Dialog backdrop and panel (#474)
1 parent 857765a commit f2d356d

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

.changeset/fix-sidebar-z-index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/kumo": patch
3+
---
4+
5+
Remove z-50 from mobile Sidebar Dialog backdrop and panel. The z-50 caused portaled floating elements (Popover, DropdownMenu, Select, Combobox) opened from inside the Sidebar to render behind the Dialog backdrop. Matches the pattern used by Kumo's own Dialog component, which relies on DOM order for stacking with no explicit z-index. Also adds `data-sidebar-backdrop` and `data-sidebar-popup` attributes as stable CSS hooks.

packages/kumo/src/components/sidebar/sidebar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,11 @@ const SidebarRoot = forwardRef<HTMLElement, SidebarRootProps>(
406406
return (
407407
<DialogBase.Root open={openMobile} onOpenChange={setOpenMobile}>
408408
<DialogBase.Portal>
409-
<DialogBase.Backdrop className="fixed inset-0 z-50 bg-black/50 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0" />
409+
<DialogBase.Backdrop data-sidebar-backdrop="" className="fixed inset-0 bg-black/50 transition-opacity duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0" />
410410
<DialogBase.Popup
411+
data-sidebar-popup=""
411412
className={cn(
412-
"fixed inset-y-0 z-50 flex w-[--sidebar-width] flex-col bg-kumo-base p-0",
413+
"fixed inset-y-0 flex w-[--sidebar-width] flex-col bg-kumo-base p-0",
413414
"duration-200 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
414415
side === "left" &&
415416
"left-0 data-[ending-style]:-translate-x-full data-[starting-style]:-translate-x-full",

0 commit comments

Comments
 (0)