Skip to content

Commit

Permalink
fix: prevent nested drawers from scrolling to top (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilkowalski authored Sep 25, 2024
1 parent 717a78d commit a8d49d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function Root({
onChange: (o: boolean) => {
onOpenChange?.(o);

if (!o) {
if (!o && !nested) {
restorePositionSetting();
}

Expand Down
2 changes: 1 addition & 1 deletion test/src/app/nested-drawers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Drawer } from 'vaul';
export default function Page() {
return (
<div className="w-screen h-screen bg-white p-8 flex justify-center items-center" data-vaul-drawer-wrapper="">
<Drawer.Root shouldScaleBackground>
<Drawer.Root>
<Drawer.Trigger asChild>
<button data-testid="trigger">Open Drawer</button>
</Drawer.Trigger>
Expand Down

0 comments on commit a8d49d0

Please sign in to comment.