Skip to content

Input of type file does not update when you set the bound files prop to undefined #16609

@kran6a

Description

@kran6a

Describe the bug

I would expect that for some markup like this

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

Setting the files variable to undefined would update the input element state to have no selected files just as it is when the files variable has an initial value of undefined.

Reproduction

https://svelte.dev/playground/hello-world?version=5.38.1#H4sIAAAAAAAACm2PMWvDQAyF_4oQGWwwSbq6cSDQoUvp0q3X4eyTmwNFZ3xy0mD838vZTUqhaBB8enp6GlHsibDEZ2IOcAk9O8jIeSWXY4GtZ4pYvo-o1y7pEsDitnXounU8E2titY30H2-CKIlGLHEXm953ujdilElhtocKVlGtUpY_psGK2pYazbK82o8JGPUtZLM2_wFGI-mbP1EY_ghTNUFiYFpz-MzM8gGcbe9tzQQ-goQLDOKo9UIO6kFBjwRPry9ATCcShaieGY72TEtCg0uypW6h7x732VTAw3a7vYmn1KbcyG7z-7fsvHTp5rWjaolnEGovrpyNq3FuE2z2RrBApS_FUvuBpo8C1Xq-eHFYtpYjTd_hmLCmwAEAAA==

Logs

System Info

Does not matter

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