Skip to content

Commit

Permalink
Merge pull request #60 from diegomrv/fix/keep-form-submited-on-field-…
Browse files Browse the repository at this point in the history
…change

Fix: mantain submitted state on field change, add novalidate to form
  • Loading branch information
ArrayKnight authored Jul 19, 2019
2 parents f68752c + 0c05153 commit 30d776c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ class Form extends Component {
...this.state.errors,
...diff,
},
submitted: false,
});
};

Expand All @@ -148,8 +147,7 @@ class Form extends Component {
this.setStateInternal({
dirty: areDirty,
errors: this.validate(config, allFields, areDirty),
fields: allFields,
submitted: false,
fields: allFields
});
};

Expand Down Expand Up @@ -312,6 +310,7 @@ class Form extends Component {
onChange={this.onChange}
onSubmit={this.onSubmit}
onReset={this.onReset}
novalidate
>
<FormProvider value={formContext}>{children}</FormProvider>
</form>
Expand Down

0 comments on commit 30d776c

Please sign in to comment.