From db1a5d4a59f8e661333f3633e9c80b73b5f72d25 Mon Sep 17 00:00:00 2001 From: Simon Farshid Date: Tue, 25 Jun 2024 16:18:24 -0700 Subject: [PATCH] fix: assistant-modal should not close on outside click (#307) --- packages/react/src/primitives/composer/ComposerInput.tsx | 2 +- .../registry/assistant-ui/assistant-modal.tsx | 5 +++-- .../shadcn-registry/registry/assistant-ui/full/thread.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react/src/primitives/composer/ComposerInput.tsx b/packages/react/src/primitives/composer/ComposerInput.tsx index cf996155f..909c6b55d 100644 --- a/packages/react/src/primitives/composer/ComposerInput.tsx +++ b/packages/react/src/primitives/composer/ComposerInput.tsx @@ -64,7 +64,7 @@ export const ComposerInput = forwardRef< const focus = useCallback(() => { const textarea = textareaRef.current; if (!textarea || !autoFocusEnabled) return; - console.log("focus"); + textarea.focus(); textarea.setSelectionRange( textareaRef.current.value.length, diff --git a/packages/shadcn-registry/registry/assistant-ui/assistant-modal.tsx b/packages/shadcn-registry/registry/assistant-ui/assistant-modal.tsx index 6bac61ac3..acb380ce4 100644 --- a/packages/shadcn-registry/registry/assistant-ui/assistant-modal.tsx +++ b/packages/shadcn-registry/registry/assistant-ui/assistant-modal.tsx @@ -27,9 +27,10 @@ export const AssistantModal = () => { e.preventDefault()} side="top" align="end" - className="h-[500px] w-[400px] rounded p-0" + className="mb-3 h-[500px] w-[400px] rounded-xl p-0" > @@ -52,7 +53,7 @@ const FloatingAssistantButton = forwardRef< variant="default" size="icon" {...rest} - className="hover:scale-70 absolute bottom-4 right-4 size-12 rounded-full shadow" + className="hover:scale-70 fixed bottom-4 right-4 size-12 rounded-full shadow" ref={ref} > { return ( - +