Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reactive require not working properly on page load #352

Open
ludovitkapusta opened this issue Dec 6, 2018 · 2 comments
Open

Reactive require not working properly on page load #352

ludovitkapusta opened this issue Dec 6, 2018 · 2 comments
Assignees
Labels
Milestone

Comments

@ludovitkapusta
Copy link
Contributor

Environment

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

What

Reactive require not working properly on page load

Current behavior

Required fields resulted from reactive way of deciding if field should be required is affecting only last one field if there is more then one reactive require.

Expected behavior

Required fields are correctly resolved after page load

Why

It looks like that reactive conditions are run only on last field that use reactive require

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.
https://codesandbox.io/s/pp1l8j2j90
when you press submit, only one checkbox is required, should be both

@kettanaito
Copy link
Owner

This is the issue of concurrent field updates, when both fieldA and fieldB are setting its property to the next value simultaneously. I've solved this previously, but this issue proves it's still doesn't work properly at some cases.

@kettanaito
Copy link
Owner

Thanks for reporting. This will be covered with the chunked state updates feature.

I'm testing the proof of concept, and it eliminates this issue. Please await for the responsive pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants