Update form components to handle pasted files
This commit is contained in:
@@ -83,6 +83,12 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
|
||||
}
|
||||
}
|
||||
|
||||
const handlePaste = (e: React.ClipboardEvent) => {
|
||||
if (e.clipboardData.files.length > 0) {
|
||||
onInputChange(e.clipboardData.files[0])
|
||||
}
|
||||
}
|
||||
|
||||
const {
|
||||
onSubmit,
|
||||
selectedModel,
|
||||
@@ -178,6 +184,7 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
|
||||
ref={textareaRef}
|
||||
className="px-2 py-2 w-full resize-none bg-transparent focus-within:outline-none focus:ring-0 focus-visible:ring-0 ring-0 dark:ring-0 border-0 dark:text-gray-100"
|
||||
required
|
||||
onPaste={handlePaste}
|
||||
rows={1}
|
||||
style={{ minHeight: "60px" }}
|
||||
tabIndex={0}
|
||||
|
||||
Reference in New Issue
Block a user