Skip to content

Commit 97ba3fc

Browse files
committed
fix(ui): layer drawers above earlier modals
1 parent d3f4f06 commit 97ba3fc

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

.changeset/late-drawers-rise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/ui': patch
3+
---
4+
5+
Ensure drawers opened from modals render above the modal and its backdrop.

packages/ui/src/elements/Drawer.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export const FloatingOverlay = React.forwardRef(function FloatingOverlay(
158158
sx={[
159159
t => ({
160160
inset: 0,
161+
zIndex: t.zIndices.$modal,
161162
backgroundColor: colors.setAlpha(t.colors.$colorBackground, 0.28),
162163
}),
163164
props.sx,
@@ -244,9 +245,8 @@ const Content = React.forwardRef<HTMLDivElement, ContentProps>(({ children }, re
244245
insetInline: 0,
245246
pointerEvents: 'none',
246247
isolation: 'isolate',
247-
// When drawer is within the profile components, we need to ensure it is above the drawer
248-
// renders above the profile close button
249-
zIndex: strategy === 'absolute' ? t.zIndices.$modal : undefined,
248+
// Drawers and modals share a stacking level so their render order determines which is on top.
249+
zIndex: t.zIndices.$modal,
250250
})}
251251
elementDescriptor={descriptors.drawerRoot}
252252
>

0 commit comments

Comments
 (0)