-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Access field errors from parent #2585
Comments
Do you only want to display the error of the touched field(s)? Or would the If you want to limit it to only touched fields, then it sounds like you are requesting some sort of |
Yes, that addition sounds reasonable.
The anytouched does work because, for example, imagine a credit card form
with a number and expiry field. Both have an error because they're null.
After I enter a valid number, then the number is touched with no error but
expiry has an error but is not touched. I want the form error to be blank
in this case because everything that has been touched has no error.
…On Feb 13, 2017 1:16 PM, "Erik Rasmussen" ***@***.***> wrote:
Do you only want to display the error of the touched field(s)? Or would
the anyTouched prop
<http://redux-form.com/6.5.0/docs/api/Props.md/#-anytouched-boolean->
help?
If you want to limit it to only touched fields, then it sounds like you
are requesting some sort of getTouchedFields(state) selector that returns
an array of field names that you could combine with the existing
getFormSyncErrors(state) selector
<http://redux-form.com/6.5.0/docs/api/Selectors.md/>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2585 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFQjvzqmrgDKTG2eVtdbfgrBWshtPpJVks5rcMg7gaJpZM4L_gBI>
.
|
Is there any new progress done on the general issue of accessing |
Published fix as |
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. |
Continued from: http://stackoverflow.com/questions/42145302/promote-a-field-error-to-a-form-error?noredirect=1#comment71566856_42145302
Sometimes, errors cannot be DOM children of input fields. A common example is when an error must be displayed above the entire form because there is no space to put the error in the DOM as a peer or child. To achieve this, knowing whether the field has been
touched
is also required by the parent. While this is achievable in a lengthlymapStateToProps
, I propose we offer a helper pattern to make this simpler.Alternatively, we could create a dummy node & create a portal to it from the child, but then the developer loses functionality of how to show the errors (since it would always be last rendered).
The text was updated successfully, but these errors were encountered: