focus input after paste

This commit is contained in:
shatfield4 2024-09-19 12:21:51 -07:00
parent af843a24c6
commit a44e56dff1
2 changed files with 4 additions and 1 deletions

View File

@ -135,6 +135,7 @@ export default function PromptInput({
value={promptInput}
className="cursor-text max-h-[50vh] md:max-h-[350px] md:min-h-[40px] mx-2 md:mx-0 py-2 w-full text-[16px] md:text-md text-white bg-transparent placeholder:text-white/60 resize-none active:outline-none focus:outline-none flex-grow"
placeholder={"Send a message"}
id="chat-input"
/>
{buttonDisabled ? (
<StopGenerationButton />

View File

@ -12,7 +12,9 @@ export function useImagePaste(onImagePaste) {
blob.name || `pasted-image.${blob.type.split("/")[1]}`;
const file = new File([blob], fileName, { type: blob.type });
onImagePaste(file);
break;
// Focus the input after paste
document.getElementById("chat-input")?.focus();
}
}
};