Patch bug with pasted text not being detected (#2386)

This commit is contained in:
Timothy Carambat 2024-09-28 15:29:31 -07:00 committed by GitHub
parent 30d2f0914a
commit 300e141736
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -121,7 +121,11 @@ export default function PromptInput({
}
const pasteText = e.clipboardData.getData("text/plain");
if (pasteText) setPromptInput((prev) => prev + pasteText.trim());
if (pasteText) {
const newPromptInput = promptInput + pasteText.trim();
setPromptInput(newPromptInput);
onChange({ target: { value: newPromptInput } });
}
return;
};