Skip to content

Submit form stoped working if some of the field already been resulted as invalidated even if they are not required #350

@ludovitkapusta

Description

@ludovitkapusta

Environment

  • OS: macOS 10.14.1
  • Node: 8.11.1
  • NPM: 5.8.0
  • react-advanaced-form: 1.6.2

What

Submit form stoped working

Current behavior

Submit form stoped working after special user scenario. With usage of conditional (reactive) require

Expected behavior

Submit should work when live changing require prop

Why

Why do you think the issue occurs?
It looks like form is resulting some inputs as invalidate, even if they are not required. Require is changing live by some other conditions

How

You have two inputs, two checkboxes. First input should be required if first checkbox is checked, second input should be required if second checkbox is checked.
Exact steps are:

  • check second checkbox, fill second input -> do submit -> submit occured
  • uncheck second checkbox, empty second input, check first checkbox, fill first input -> do submit -> submit didnt happen
    https://codesandbox.io/s/pp1l8j2j90

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions