mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-27 04:44:10 +01:00
🪹 fix: Prevent whitespace-only Chat input Submissions (#11838)
fix(input): normalize chat input text before submit Trim input text before checking if empty to show submit button as disabled
This commit is contained in:
parent
2ec64af551
commit
dbf8cd40d3
2 changed files with 4 additions and 2 deletions
|
|
@ -41,7 +41,8 @@ const SubmitButton = React.memo(
|
|||
const SendButton = React.memo(
|
||||
forwardRef((props: SendButtonProps, ref: React.ForwardedRef<HTMLButtonElement>) => {
|
||||
const data = useWatch({ control: props.control });
|
||||
return <SubmitButton ref={ref} disabled={props.disabled || !data.text} />;
|
||||
const content = data?.text?.trim();
|
||||
return <SubmitButton ref={ref} disabled={props.disabled || !content} />;
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue