Skip to content

Commit 30d776c

Browse files
authored
Merge pull request #60 from diegomrv/fix/keep-form-submited-on-field-change
Fix: mantain submitted state on field change, add novalidate to form
2 parents f68752c + 0c05153 commit 30d776c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Form.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ class Form extends Component {
125125
...this.state.errors,
126126
...diff,
127127
},
128-
submitted: false,
129128
});
130129
};
131130

@@ -148,8 +147,7 @@ class Form extends Component {
148147
this.setStateInternal({
149148
dirty: areDirty,
150149
errors: this.validate(config, allFields, areDirty),
151-
fields: allFields,
152-
submitted: false,
150+
fields: allFields
153151
});
154152
};
155153

@@ -312,6 +310,7 @@ class Form extends Component {
312310
onChange={this.onChange}
313311
onSubmit={this.onSubmit}
314312
onReset={this.onReset}
313+
novalidate
315314
>
316315
<FormProvider value={formContext}>{children}</FormProvider>
317316
</form>

0 commit comments

Comments
 (0)