Closed
Description
- Do you want to request a feature or report a bug?
Report a bug
- What is the current behavior?
Given 'validateBeforeSubmit' is true and form data does not pass validation rules
When I click submit button, onSubmit function is called
- Demo
https://jsfiddle.net/nzkm7put/ (please check the result in console)
-
What is the expected behavior?
onSubmit event should not be called -
Please tell us about your environment:
- Version: 2.3.1
- Browser: Chrome 69
- Language: ES6/7
- Other information:
This may look like #434 but I'm using the built in onSubmit method, no form wrapper here so I think it is a different issue.
I have looked into the source code and found the call stack as below:
- fieldSubmit.onClick()
- formGroup.validate() <-- I think the problem is here, this should call the parent's validate() instead of child's one
- abstractField@validate() <-- submit button does not have any validator, of course this will pass, that's why there is no error