react icon indicating copy to clipboard operation
react copied to clipboard

Implement suppress reset property

Open alexdln opened this issue 1 year ago • 1 comments

  • 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

alexdln avatar Aug 16 '24 19:08 alexdln

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

vercel[bot] avatar Aug 16 '24 19:08 vercel[bot]

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.

github-actions[bot] avatar Nov 19 '24 14:11 github-actions[bot]

bump

yadokarization avatar Jan 22 '25 20:01 yadokarization

would like to see that !

danielraab avatar Feb 27 '25 15:02 danielraab

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.

github-actions[bot] avatar Jul 13 '25 22:07 github-actions[bot]

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!

github-actions[bot] avatar Jul 20 '25 22:07 github-actions[bot]