Skip to content

Commit

Permalink
fix: assistant-modal should not close on outside click (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonom authored Jun 25, 2024
1 parent a7ea246 commit db1a5d4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/primitives/composer/ComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ export const AssistantModal = () => {
<FloatingAssistantButton />
</PopoverTrigger>
<PopoverContent
onInteractOutside={(e) => 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"
>
<Thread />
</PopoverContent>
Expand All @@ -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}
>
<BotIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
export const Thread: FC = () => {
return (
<TooltipProvider>
<ThreadPrimitive.Root className="flex h-full flex-col items-center pb-3">
<ThreadPrimitive.Root className="flex h-full flex-col items-center pb-4">
<ThreadPrimitive.Viewport className="flex w-full flex-grow flex-col items-center overflow-y-scroll scroll-smooth px-4 pt-12">
<ThreadPrimitive.Empty>
<ThreadEmpty />
Expand Down

0 comments on commit db1a5d4

Please sign in to comment.