Skip to content

Bug: Forms are reset when action fails #35295

@OliverJAsh

Description

@OliverJAsh

React version: 19.2.1

Steps To Reproduce

  1. Enter some text into the input and submit. The action will fail.

Link to code example:

https://codesandbox.io/p/sandbox/suspicious-artem-vdplnn?file=%2Fsrc%2FApp.js%3A4%2C20

The current behavior

The form is reset.

The expected behavior

The form is not reset when the action fails. The docs suggest that reset should only happen when the action is successful:

After the action function succeeds, all uncontrolled field elements in the form are reset.

Related: #29034

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions