forked from XiaoMo/ChatGPT-Next-Web
fix: #804 disable auto scroll in textarea
This commit is contained in:
parent
b0f7aeece5
commit
fb14785cad
@ -442,16 +442,6 @@ export function Chat(props: {
|
|||||||
inputRef.current?.focus();
|
inputRef.current?.focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
const scrollInput = () => {
|
|
||||||
const dom = inputRef.current;
|
|
||||||
if (!dom) return;
|
|
||||||
const paddingBottomNum: number = parseInt(
|
|
||||||
window.getComputedStyle(dom).paddingBottom,
|
|
||||||
10,
|
|
||||||
);
|
|
||||||
dom.scrollTop = dom.scrollHeight - dom.offsetHeight + paddingBottomNum;
|
|
||||||
};
|
|
||||||
|
|
||||||
// auto grow input
|
// auto grow input
|
||||||
const [inputRows, setInputRows] = useState(2);
|
const [inputRows, setInputRows] = useState(2);
|
||||||
const measure = useDebouncedCallback(
|
const measure = useDebouncedCallback(
|
||||||
@ -476,7 +466,6 @@ export function Chat(props: {
|
|||||||
// only search prompts when user input is short
|
// only search prompts when user input is short
|
||||||
const SEARCH_TEXT_LIMIT = 30;
|
const SEARCH_TEXT_LIMIT = 30;
|
||||||
const onInput = (text: string) => {
|
const onInput = (text: string) => {
|
||||||
scrollInput();
|
|
||||||
setUserInput(text);
|
setUserInput(text);
|
||||||
const n = text.trim().length;
|
const n = text.trim().length;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user