jaredpalmer/formik

setFieldError does not prevent handleSubmit

開放

#1,111 建立於 2018年11月15日

 (10 則留言) (3 個反應) (0 位負責人)TypeScript (2,801 個分叉)batch import
Priority: MediumType: Bughelp wantedpinned

倉庫指標

星標
 (34,255 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

🐛 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

貢獻者指南