Browse Source

fix: mobile textarea autofocus ui error

iSource 1 năm trước cách đây
mục cha
commit
71f119c9e8
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 3 3
      app/components/home.tsx

+ 3 - 3
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 };
   type RenderMessage = Message & { preview?: boolean };
 
 
   const chatStore = useChatStore();
   const chatStore = useChatStore();
@@ -444,7 +444,7 @@ export function Chat(props: { showSideBar?: () => void }) {
               setAutoScroll(false);
               setAutoScroll(false);
               setTimeout(() => setPromptHints([]), 100);
               setTimeout(() => setPromptHints([]), 100);
             }}
             }}
-            autoFocus
+            autoFocus={!props?.sideBarShowing}
           />
           />
           <IconButton
           <IconButton
             icon={<SendWhiteIcon />}
             icon={<SendWhiteIcon />}
@@ -646,7 +646,7 @@ export function Home() {
             }}
             }}
           />
           />
         ) : (
         ) : (
-          <Chat key="chat" showSideBar={() => setShowSideBar(true)} />
+          <Chat key="chat" showSideBar={() => setShowSideBar(true)} sideBarShowing={showSideBar} />
         )}
         )}
       </div>
       </div>
     </div>
     </div>