mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-09 03:26:38 +08:00
fix: distinguish PC/Mobile behavior on auto-scroll
The chat list should be set to auto-scroll on mobile screen when the input textarea is focused. It should not behave like that on PC screen because user may want to refer to previous content.
This commit is contained in:
parent
b90efe8116
commit
fdf8e5e6b4
@ -421,6 +421,7 @@ export function Chat(props: {
|
||||
// check if should send message
|
||||
const onInputKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
if (shouldSubmit(e)) {
|
||||
setAutoScroll(true);
|
||||
onUserSubmit();
|
||||
e.preventDefault();
|
||||
}
|
||||
@ -667,7 +668,7 @@ export function Chat(props: {
|
||||
onInput={(e) => onInput(e.currentTarget.value)}
|
||||
value={userInput}
|
||||
onKeyDown={onInputKeyDown}
|
||||
onFocus={() => setAutoScroll(true)}
|
||||
onFocus={() => setAutoScroll(isMobileScreen())}
|
||||
onBlur={() => {
|
||||
setAutoScroll(false);
|
||||
setTimeout(() => setPromptHints([]), 500);
|
||||
|
Loading…
Reference in New Issue
Block a user