mirror of https://github.com/VERT-sh/VERT.git
Make dialog default to only show supported formats
This commit is contained in:
parent
00a855e590
commit
71e26cc3c3
|
@ -10,6 +10,7 @@
|
|||
files: File[] | undefined;
|
||||
onupload?: () => void;
|
||||
isMobile: boolean;
|
||||
acceptedFormats?: string[];
|
||||
}
|
||||
|
||||
$effect(() => {
|
||||
|
@ -20,7 +21,7 @@
|
|||
let fileInput = $state<HTMLInputElement>();
|
||||
let dragOver = $state(false);
|
||||
|
||||
let { files = $bindable(), onupload, isMobile }: Props = $props();
|
||||
let { files = $bindable(), onupload, isMobile, acceptedFormats }: Props = $props();
|
||||
|
||||
function upload() {
|
||||
if (!fileInput) return;
|
||||
|
@ -108,6 +109,7 @@
|
|||
class="hidden"
|
||||
bind:this={fileInput}
|
||||
onchange={addFiles}
|
||||
accept={acceptedFormats?.join(",") ?? "*"}
|
||||
multiple
|
||||
/>
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@
|
|||
isMobile={data.isMobile}
|
||||
bind:files={ourFiles}
|
||||
onupload={runUpload}
|
||||
acceptedFormats={converters.flatMap((c) => c.supportedFormats)}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue