Skip to content

[Bug]: Drawer modal settings doesn't change anythingΒ #103

@ignatz

Description

@ignatz

Bug description

Maybe I'm holding it wrong, however when I C&P the first drawer example and simply set modal={false}, it still acts as a modal (e.g. handles off-drawer pointer events and closes):

      <Drawer breakPoints={[0.75]} modal={false}>
        {(props) => (
          <>
            <Drawer.Trigger class="my-auto rounded-lg bg-corvu-100 px-4 py-3 text-lg font-medium transition-all duration-100 hover:bg-corvu-200 active:translate-y-0.5">
              Open Drawer
            </Drawer.Trigger>

            <Drawer.Portal>
              <Drawer.Overlay
                class="fixed inset-0 z-50 data-transitioning:transition-colors data-transitioning:duration-500 data-transitioning:ease-[cubic-bezier(0.32,0.72,0,1)]"
                style={{
                  'background-color': `rgb(0 0 0 / ${0.5 * props.openPercentage
                    })`,
                }}
              />
              <Drawer.Content class="fixed inset-x-0 bottom-0 z-50 flex h-full max-h-125 flex-col rounded-t-lg border-t-4 border-corvu-400 bg-corvu-100 pt-3 after:absolute after:inset-x-0 after:top-[calc(100%-1px)] after:h-1/2 after:bg-inherit data-transitioning:transition-transform data-transitioning:duration-500 data-transitioning:ease-[cubic-bezier(0.32,0.72,0,1)] md:select-none">
                <div class="h-1 w-10 self-center rounded-full bg-corvu-400" />
                <Drawer.Label class="mt-2 text-center text-xl font-bold">
                  I'm a drawer!
                </Drawer.Label>
                <Drawer.Description class="mt-1 text-center">
                  Drag down to close me.
                </Drawer.Description>
                <p class="absolute inset-x-0 -bottom-5 z-10 text-center">
                  🐸 You found froggy!
                </p>
              </Drawer.Content>
            </Drawer.Portal>
          </>
        )}
      </Drawer>
Screencast.From.2026-01-31.20-27-48.mp4

Reproduction Link

https://stackblitz.com/edit/corvu-pd6khrun?file=src%2FApp.tsx

Reproduction Steps

  1. Open the drawer
  2. Snap to 50%
  3. tap outside the drawer and watch the drawer close

Expected behavior

when modal={false} allow pointer events outside the drawer

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions