Skip to content
New issue

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

Missing HTMLInputAttributes property for files & group #14579

Closed
dvcol opened this issue Dec 5, 2024 · 0 comments
Closed

Missing HTMLInputAttributes property for files & group #14579

dvcol opened this issue Dec 5, 2024 · 0 comments

Comments

@dvcol
Copy link
Contributor

dvcol commented Dec 5, 2024

Describe the bug

Unless I'm mistaken, it seems that the files and group attributes are missing from the HTMLInputAttributes type in svelte/packages/svelte/element.d.ts.

The typings for the binding 'bind:group' and 'bind:files' are present (as seen here) but the individual properties aren't.

However, the bindings exists on the deprecated SvelteInputProps, so maybe this is intentional somehow ?

Reproduction

Any typing of HTMLInputAttributes will raise ts or svelte/check errors, like this:

<script lang="ts">
  import type { HTMLInputAttributes } from 'svelte/elements';

  let { files = $bindable() } : HTMLInputAttributes
</script>

<input type="file" bind:files />

As a workaround I've been extending the types:

type HTMLInputAttributes = HTMLInputAttributes & {
    files?: HTMLInputAttributes['bind:files'];
    group?: HTMLInputAttributes['bind:group'];
};

Logs

No response

System Info

svelte: ^5.4.0 => 5.4.0

Severity

annoyance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant