form icon indicating copy to clipboard operation
form copied to clipboard

Devtools show null instead of NaN

Open Sam-Kruglov opened this issue 4 months ago • 0 comments

Describe the bug

I set the field to Number.NaN but in devtools I see null.

I set all number fields to NaN in tanstack form but I convert it to empty string when actually setting <input value={...} inside of my field.MyInput because that's what the "not set" value for all inputs is supposed to be in HTML for whatever reason, even for type="number".

Your minimal, reproducible example

too busy

Steps to reproduce

set some number to nan in default values and observe devtools

Expected behavior

value: NaN

actual: null (not even the value: part. Also for groups it'll show value: {null,null, "someStringField": "", null}

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

mac, chrome

TanStack Form adapter

react-form

TanStack Form version

1.23.0

TypeScript version

5.9.2

Additional context

No response

Sam-Kruglov avatar Sep 30 '25 03:09 Sam-Kruglov