Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#146 from iSource/fix-mobile-autofocus
Browse files Browse the repository at this point in the history
fix: mobile textarea autofocus ui error
  • Loading branch information
Yidadaa authored Mar 29, 2023
2 parents a075c0d + be9917f commit 91a36c7
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 @@ -446,7 +446,7 @@ export function Chat(props: { showSideBar?: () => void }) {
setAutoScroll(false);
setTimeout(() => setPromptHints([]), 100);
}}
autoFocus
autoFocus={!props?.sideBarShowing}
/>
<IconButton
icon={<SendWhiteIcon />}
Expand Down Expand Up @@ -648,7 +648,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 91a36c7

Please sign in to comment.