From be9917f9dc8e72beb288082e4c657cac7d4ae28a Mon Sep 17 00:00:00 2001 From: iSource Date: Wed, 29 Mar 2023 15:45:31 +0800 Subject: [PATCH] fix: mobile textarea autofocus ui error --- app/components/home.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/home.tsx b/app/components/home.tsx index 828ee191634..c2ead8c18e0 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -170,7 +170,7 @@ export function PromptHints(props: { ); } -export function Chat(props: { showSideBar?: () => void }) { +export function Chat(props: { showSideBar?: () => void, sideBarShowing?: boolean }) { type RenderMessage = Message & { preview?: boolean }; const chatStore = useChatStore(); @@ -444,7 +444,7 @@ export function Chat(props: { showSideBar?: () => void }) { setAutoScroll(false); setTimeout(() => setPromptHints([]), 100); }} - autoFocus + autoFocus={!props?.sideBarShowing} /> } @@ -646,7 +646,7 @@ export function Home() { }} /> ) : ( - setShowSideBar(true)} /> + setShowSideBar(true)} sideBarShowing={showSideBar} /> )}