Implement suppress reset property
- add tests for suppress-reset property
- implement suppress reset property
Summary
Added a suppressReset prop. Without it, the behavior remains the same - the form will reset all fields to default values after the action is completed. With it, the form will not reset the data.
This is more of a suggestion for a possible solution. I chose this specific naming because it affects React's internal behavior.
For client actions, we can consider other possible solutions (for example, passing a pseudo-event that can call preventDefault()), but for server actions, I think there's not much we can do (except perhaps tracking the result and, for example, if it's false - doing a reset). And the functionality, as mentioned in the related task, is necessary.
If I've missed something or there are doubts, or if something needs better test coverage - please let me know, I'll improve the necessary aspects.
Fixes #29034 Closes #29034
How did you test this change?
The first video is without this property, the second is with it.
https://github.com/user-attachments/assets/d495e019-a036-44b5-8003-bd9294c1ce7b
https://github.com/user-attachments/assets/296c0a19-1877-48c0-8910-8fe9b43aa68a
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| react-compiler-playground | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Aug 21, 2024 1:20pm |
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
bump
would like to see that !
This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.
Closing this pull request after a prolonged period of inactivity. If this issue is still present in the latest release, please ask for this pull request to be reopened. Thank you!