app: file type filter on desktop + multiple files (#18403)
This commit is contained in:
parent
27a70ad70f
commit
d0a57305ef
9 changed files with 120 additions and 60 deletions
|
|
@ -1383,11 +1383,16 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
|
|||
<input
|
||||
ref={fileInputRef}
|
||||
type="file"
|
||||
multiple
|
||||
accept={ACCEPTED_FILE_TYPES.join(",")}
|
||||
class="hidden"
|
||||
onChange={(e) => {
|
||||
const file = e.currentTarget.files?.[0]
|
||||
if (file) void addAttachment(file)
|
||||
const list = e.currentTarget.files
|
||||
if (list) {
|
||||
for (const file of Array.from(list)) {
|
||||
void addAttachment(file)
|
||||
}
|
||||
}
|
||||
e.currentTarget.value = ""
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue