React version: 19.2.1
Steps To Reproduce
- Enter some text into the input and submit. The action will fail.
Link to code example:
https://codesandbox.io/p/devbox/funny-jang-3zj83m?file=%2Fsrc%2Findex.js%3A7%2C4&workspaceId=ws_4qKVDKGuRrrvd8oLfoRWSz
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
React version: 19.2.1
Steps To Reproduce
Link to code example:
https://codesandbox.io/p/devbox/funny-jang-3zj83m?file=%2Fsrc%2Findex.js%3A7%2C4&workspaceId=ws_4qKVDKGuRrrvd8oLfoRWSz
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:
Related: #29034