Skip to content

Commit d0a9f62

Browse files
authored
fix: Fix AI chat not opening on home page (#11514)
## Summary - Moves responsive visibility classes from `Portal.Root` to inner `<div>` element - `Portal.Root` from `radix-ui` doesn't support `className` prop, so the classes were being ignored The AI chat wasn't opening because the `hidden md:block` classes on `Portal.Root` had no effect, causing the portal content to not render properly on desktop.
1 parent f11f3a4 commit d0a9f62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/site/components/geistdocs/chat.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,13 @@ export const Chat = ({ basePath, suggestions }: ChatProps) => {
387387
<span>Ask AI</span>
388388
</Button>
389389

390-
<Portal.Root className="hidden md:block">
390+
<Portal.Root>
391391
<div
392392
className={cn(
393393
"fixed z-50 flex flex-col gap-4 bg-background transition-all",
394394
"inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
395-
"translate-x-full data-[state=open]:translate-x-0"
395+
"translate-x-full data-[state=open]:translate-x-0",
396+
"hidden md:flex"
396397
)}
397398
data-state={isOpen ? "open" : "closed"}
398399
>

0 commit comments

Comments
 (0)