Skip to content

Submit button does not call form validator #506

Closed
@qduc

Description

@qduc
  • 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
  • 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions