Skip to content

Commit

Permalink
fix: mobile textarea autofocus ui error
Browse files Browse the repository at this point in the history
  • Loading branch information
iSource committed Mar 29, 2023
1 parent b2a2634 commit be9917f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/components/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -444,7 +444,7 @@ export function Chat(props: { showSideBar?: () => void }) {
setAutoScroll(false);
setTimeout(() => setPromptHints([]), 100);
}}
autoFocus
autoFocus={!props?.sideBarShowing}
/>
<IconButton
icon={<SendWhiteIcon />}
Expand Down Expand Up @@ -646,7 +646,7 @@ export function Home() {
}}
/>
) : (
<Chat key="chat" showSideBar={() => setShowSideBar(true)} />
<Chat key="chat" showSideBar={() => setShowSideBar(true)} sideBarShowing={showSideBar} />
)}
</div>
</div>
Expand Down

0 comments on commit be9917f

Please sign in to comment.