We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Right now, we are unable to bind files for multiple uploads. Is it possible that we can add this feature too?
Here's my dirty implementation. if this is good, should I make a PR?
<script lang="ts"> import type { HTMLInputAttributes } from 'svelte/elements'; import type { WithElementRef } from 'bits-ui'; import { cn } from '$lib/utils/index.js'; let { ref = $bindable(null), value = $bindable(), files = $bindable(), class: className, type, ...restProps }: WithElementRef<HTMLInputAttributes & { files?: FileList }> = $props(); const defaultClass = 'border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50'; </script> {#if type === 'file'} <input bind:this={ref} type="file" class={cn(defaultClass, className)} bind:value bind:files {...restProps} /> {:else} <input bind:this={ref} {type} class={cn(defaultClass, className)} bind:value {...restProps} /> {/if}
The text was updated successfully, but these errors were encountered:
The issue here is that now files exist on the type even for inputs that aren't of type file. Will need to look into this one further.
file.
Sorry, something went wrong.
Thanks hunter!
No branches or pull requests
Prerequisites
Describe the feature
Right now, we are unable to bind files for multiple uploads. Is it possible that we can add this feature too?
Here's my dirty implementation. if this is good, should I make a PR?
The text was updated successfully, but these errors were encountered: