Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textarea can be reset only be explicitly dispatching reset() when submitting form #588

Closed
adiachenko opened this issue Jan 25, 2016 · 4 comments

Comments

@adiachenko
Copy link

Textarea doesn't reset after submitting form even with the known fix below:

<textarea {...body} value={body.value || ''} />

Currently I am explicitly dispatching reset when resolving Promise in onSubmit callback. This works, but it's kinda ugly. There are no particular deviations in my code, it's pretty similar to what you can find in official examples.

@erikras
Copy link
Member

erikras commented Jan 25, 2016

Sounds like another unforeseen side effect of #370 (comment). 😦

@adiachenko
Copy link
Author

Wow, I never noticed it but it seems like other inputs work the same way. I'm wondering whether it's an expected behavior. Feel free to close this issue if that is the case. I may be missing something here.

@erikras
Copy link
Member

erikras commented Jan 25, 2016

It was a conscious decision taken in the previously linked issue, for all the reasons discussed there, to not re-initialize based on the initialValues prop the second time. I'm not 100% sure that it was the right decision, because you are exactly right to expect it to behave as you expected it to.

@lock
Copy link

lock bot commented Jun 1, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants