TanStack / TanStack/form

Prevent File from adding properties into form fields

Open
#1,938 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

v1 v2: needs investigation
Dominant language
TypeScript
Stars
6.7k
Forks
682
Avg merge
5d 18h
Merged PRs (30d)
7

Description

Describe the bug

When we add a field to the form validator, it adds all properties from the file object into the form fields, this really messes up the auto complete and seems unnecessary.

Your minimal, reproducible example

https://stackblitz.com/edit/vitejs-vite-hw3jlbst?file=src%2FApp.tsx

Steps to reproduce
  1. create a form
  2. add a validation for a file (for example z.file())
  3. try to auto complete a field with the name of the file
Expected behavior

Only show the file field itself, not its properties

How often does this bug happen?

Every time

Screenshots or Videos
Image
Platform
  • OS: Windows 11
  • VSCode
TanStack Form adapter

react-form

TanStack Form version

1.27.3

TypeScript version

5.9.3

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducible example in src/App.tsx and the form validation using z.file(). Check how the file field is represented for autocomplete, then verify that only the file field appears and its properties are excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.