mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 09:20:15 +01:00
📋 fix: Ensure Textarea Resizes in Clipboard Edge Case (#2268)
* chore: ts-ignore fake conversation data used for testing * chore(useTextarea): import helper functions to declutter hook * fix(Textarea): reset textarea value explicitly by resetting `textAreaRef.current.value`
This commit is contained in:
parent
d07396d308
commit
aff219c655
6 changed files with 63 additions and 55 deletions
|
|
@ -3,9 +3,9 @@ import { useForm } from 'react-hook-form';
|
|||
import { memo, useCallback, useRef, useMemo } from 'react';
|
||||
import {
|
||||
supportsFiles,
|
||||
EModelEndpoint,
|
||||
mergeFileConfig,
|
||||
fileConfig as defaultFileConfig,
|
||||
EModelEndpoint,
|
||||
} from 'librechat-data-provider';
|
||||
import { useChatContext, useAssistantsMapContext } from '~/Providers';
|
||||
import { useRequiresKey, useTextarea } from '~/hooks';
|
||||
|
|
@ -43,9 +43,9 @@ const ChatForm = ({ index = 0 }) => {
|
|||
setFiles,
|
||||
conversation,
|
||||
isSubmitting,
|
||||
handleStopGenerating,
|
||||
filesLoading,
|
||||
setFilesLoading,
|
||||
handleStopGenerating,
|
||||
} = useChatContext();
|
||||
|
||||
const assistantMap = useAssistantsMapContext();
|
||||
|
|
@ -57,7 +57,9 @@ const ChatForm = ({ index = 0 }) => {
|
|||
}
|
||||
ask({ text: data.text });
|
||||
methods.reset();
|
||||
textAreaRef.current?.setRangeText('', 0, data.text.length, 'end');
|
||||
if (textAreaRef.current) {
|
||||
textAreaRef.current.value = '';
|
||||
}
|
||||
},
|
||||
[ask, methods],
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue