pacocoursey / cmdk

Fast, unstyled command menu React component.
https://cmdk.paco.me
MIT License
9.56k stars 274 forks source link

Not working on NextJS #38

Closed heymartinadams closed 2 years ago

heymartinadams commented 2 years ago

Hi @raunofreiberg, for some reason, I’m unable to get it to work on NextJS (using latest next and react, react-dom). I’ve included a basic reproduction here: cmdk-nextjs.

As you can see below, nothing happens. I must be missing something basic, but have no idea what I’m missing.

CleanShot 2022-08-17 at 08 47 58

pacocoursey commented 2 years ago

You're putting a Dialog inside of a Popover, and the dialog is always closed. You should just use the regular Command component:

<Popover.Content>
  <Command>
    ...
  </Command>
</Popover.Content>