Conversation
|
There was a problem hiding this comment.
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 | nullwhentype: "file"in theInputcomponent props. - Preserve the existing restriction that
filesis 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.
<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')} />