Skip to content

feat: allow files=null in Input, to match SvelteKit remote forms - #2845

Open
osvein wants to merge 1 commit into
huntabyte:mainfrom
osvein:patch-1
Open

osvein wants to merge 1 commit into
huntabyte:mainfrom
osvein:patch-1

Conversation

@osvein

@osvein osvein commented Aug 12, 2026

Copy link
Copy Markdown

<input type="file" files={null} /> is valid for the HTML input tag, so the Input component should also allow it.

This is especially useful when using SvelteKit remote forms .as('file'), which includes files=null in its return type. Without this change, this causes a type error: <Input {...form.fields.as('file')} />

Copilot AI lite review requested due to automatic review settings August 12, 2026 09:47
@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 74fbeba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Input UI component’s TypeScript props to accept files={null} for type="file", aligning the component’s typing with the underlying HTML input behavior and improving compatibility with SvelteKit remote forms (.as('file')).

Changes:

  • Allow files?: FileList | null when type: "file" in the Input component props.
  • Preserve the existing restriction that files is not allowed for non-file input types.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Successfully merging this pull request may close these issues.

2 participants