pacocoursey / cmdk

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

Radix Tooltip and Command Incompatible? When typing: TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. #193

Closed arkmech closed 7 months ago

arkmech commented 7 months ago

I was adding a Radix Tooltip inside <Command/ > and it renders, but when you start typing in the Command Input, I get this error

Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.

Removing the Tooltip resolves the issue.

<Command>
  <Command.Input />
     <Tooltip.Provider>
      <Tooltip.Root delayDuration={delayDuration} {...props}>
        <Tooltip.Trigger><Icon /></Tooltip.Trigger>
         Hello
      </TooltipPrimitive.Root>
    </TooltipPrimitive.Provider>
  <Command.List>
    {loading && <Command.Loading>Hang on…</Command.Loading>}
    <Command.Empty>No results found.</Command.Empty>
    <Command.Group heading="Fruits">
      <Command.Item>Apple</Command.Item>
      <Command.Item>Orange</Command.Item>
      <Command.Separator />
      <Command.Item>Pear</Command.Item>
      <Command.Item>Blueberry</Command.Item>
    </Command.Group>
    <Command.Item>Fish</Command.Item>
  </Command.List>
</Command>

<Icon /> forwards ref

arkmech commented 7 months ago

Had nothing to do with tooltip, the issue was having a <div /> right under <Command.List />