jaredpalmer/formik

setFieldError does not prevent handleSubmit

Open

#1.111 geöffnet am 15. Nov. 2018

Auf GitHub ansehen
 (10 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)TypeScript (2.801 Forks)batch import
Priority: MediumType: Bughelp wantedpinned

Repository-Metriken

Stars
 (34.255 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

🐛 Bug report

This looks like it may be a possible regression on #317, as I can replicate it in the exact same way.

Current Behavior

After setting an error using setFieldError, the handleSubmit function is successfully fired.

Expected behavior

The form should not submit successfully, as there is an error.

Reproducible example

Click "Set Error". You will then be able to successfully submit. https://codesandbox.io/s/43owlv689

Suggested solution(s)

Your environment

Software Version(s)
Formik 1.3.2
React 16.4.2
TypeScript
Browser Chrome
npm/Yarn 6.1.0
Operating System OSX

Contributor Guide