File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
client/modules/User/components Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ function SignupForm() {
72
72
function onSubmit ( formProps ) {
73
73
return dispatch ( validateAndSignUpUser ( formProps ) ) ;
74
74
}
75
+ function shouldShowError ( meta ) {
76
+ return ( meta . touched || meta . submitFailed ) && meta . error ;
77
+ }
75
78
76
79
return (
77
80
< Form
@@ -102,7 +105,7 @@ function SignupForm() {
102
105
autoCapitalize = "none"
103
106
{ ...field . input }
104
107
/>
105
- { field . meta . touched && field . meta . error && (
108
+ { shouldShowError ( field . meta ) && (
106
109
< span className = "form-error" aria-live = "polite" >
107
110
{ field . meta . error }
108
111
</ span >
@@ -124,7 +127,7 @@ function SignupForm() {
124
127
autoComplete = "email"
125
128
{ ...field . input }
126
129
/>
127
- { field . meta . touched && field . meta . error && (
130
+ { shouldShowError ( field . meta ) && (
128
131
< span className = "form-error" aria-live = "polite" >
129
132
{ field . meta . error }
130
133
</ span >
@@ -160,7 +163,7 @@ function SignupForm() {
160
163
) }
161
164
</ button >
162
165
</ div >
163
- { field . meta . touched && field . meta . error && (
166
+ { shouldShowError ( field . meta ) && (
164
167
< span className = "form-error" aria-live = "polite" >
165
168
{ field . meta . error }
166
169
</ span >
@@ -196,7 +199,7 @@ function SignupForm() {
196
199
) }
197
200
</ button >
198
201
</ div >
199
- { field . meta . touched && field . meta . error && (
202
+ { shouldShowError ( field . meta ) && (
200
203
< span className = "form-error" aria-live = "polite" >
201
204
{ field . meta . error }
202
205
</ span >
You can’t perform that action at this time.
0 commit comments