From 0c665c0214f4f345c11c27de15816679aa865e25 Mon Sep 17 00:00:00 2001 From: iSource Date: Wed, 29 Mar 2023 14:52:48 +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 850c51774..65a55d8f1 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -146,7 +146,7 @@ function useSubmitHandler() { }; } -export function Chat(props: { showSideBar?: () => void }) { +export function Chat(props: { showSideBar?: () => void, sideBarShowing?: boolean }) { type RenderMessage = Message & { preview?: boolean }; const [session, sessionIndex] = useChatStore((state) => [ @@ -384,7 +384,7 @@ export function Chat(props: { showSideBar?: () => void }) { onKeyDown={(e) => onInputKeyDown(e as any)} onFocus={() => setAutoScroll(true)} onBlur={() => setAutoScroll(false)} - autoFocus + autoFocus={!props?.sideBarShowing} /> } @@ -584,7 +584,7 @@ export function Home() { }} /> ) : ( - setShowSideBar(true)} /> + setShowSideBar(true)} sideBarShowing={showSideBar}/> )}