Skip to content

Missing HTMLInputAttributes property for files & group #14579

@dvcol

Description

@dvcol

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy