Skip to content

onMount Error is not revalidated when the user changes the input #689

Closed

Description

@MAST1999

Describe the bug

If you have an onMount that returns an error on the first render, changing the value after that does not remove the error.

Your minimal, reproducible example

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

Steps to reproduce

Open the reproduction and see that the onMount returns error, but after changing the value the error still remains.

Expected behavior

The onMount error should be revalidated (removed) after user changes the value.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

OS: Linux
Browser: Chrome
Version: 124.0.63

TanStack Form adapter

None

TanStack Form version

^0.19.4

TypeScript version

^5.4.5

Additional context

No response

Activity

  1. tobysmith568 commented on May 8, 2024

    @tobysmith568

    Hey @crutchcorn, is there a public timeline/kanban board/etc. somewhere where we can gauge an estimate for how long it will be until this might be worked on? I ask because I can see it's not assigned to anyone to fix in the meantime.

  2. crutchcorn commented on May 8, 2024

    @crutchcorn
    Contributor

    This is the public timeline/board :)

  3. self-assigned this
    on May 30, 2024
  4. borntorun commented on Feb 19, 2025

    @borntorun

    Hi

    I have a question related to this issue:

    At what point are onMount errors cleared?
    Reading this I assumed they would be when the field is touched, but it turns out it is only performed when it changes (isDirty = true).

    I don't know if that was the idea, or if it's a bug...

    The only solution to avoid duplicate errors is to check the isDirty status in the event and perform validation accordingly?

    I'm using v0.42.0 , as can be seen on this example to explain what I'm saying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: bugThis is a bug in behaviour.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions