Next.js Discord

Discord Forum

Shadcn components (DropdownMenu, Sheet, Dialog) open but won’t close

Unanswered
Barbary Lion posted this in #help-forum
Open in Discord
Barbary LionOP
Hello!
I’m having a strange issue in my Next.js 15 project using shadcn/ui (Radix under the hood).

All Radix-based components — like DropdownMenu, Sheet, Dialog, etc. — open correctly, but I can’t close them.
Clicking the trigger again or clicking outside does nothing.
The same happens for all of them, so it seems like a global issue rather than a single component.
Even the examples from their official docs do not work.

Has anyone run into this before?

Here is a sample component which does not work:

            <DropdownMenu>
                <DropdownMenuTrigger asChild>
                    <Button
                        variant='ghost'
                        className='data-[state=open]:bg-muted text-muted-foreground flex size-8'
                        size='icon'
                    >
                        <EllipsisVertical />
                        <span className='sr-only'>Open menu</span>
                    </Button>
                </DropdownMenuTrigger>
                <DropdownMenuContent align='end' className='bg-background w-32'>
                    <DropdownMenuItem>Edit</DropdownMenuItem>
                    <DropdownMenuItem>Make a copy</DropdownMenuItem>
                    <DropdownMenuItem>Favorite</DropdownMenuItem>
                    <DropdownMenuSeparator />
                    <DropdownMenuItem>Delete</DropdownMenuItem>
                </DropdownMenuContent>
            </DropdownMenu>

0 Replies