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

Handle clearing of controlled fields #280

Open
2 tasks
kettanaito opened this issue Sep 5, 2018 · 1 comment
Open
2 tasks

Handle clearing of controlled fields #280

kettanaito opened this issue Sep 5, 2018 · 1 comment
Labels
enhancement Enhances existing functionality. good first issue Good for newcomers. needs:clarification needs:testing scope:architecture Changes affect architecture.
Milestone

Comments

@kettanaito
Copy link
Owner

Environment

  • react-advanaced-form: 1.4.1

What

Need to properly handle controlled fields clear.

Why

Although there is the onClear callback function exposed to clear the values of the controlled fields, after that it validated the fields as invalid. That is obvious, since clearing the controlled value invokes onChange event, and that results into validation of the field. That is the correct chain of events, but the unexpected one for clearing scenario.

How

Reset has a similar functionality, where proper validity status of the fields is achieved by explicit validation with the custom predicate function supplied. However, I am not sure if reset of controlled fields was properly tested.

Roadmap

  • Provide integration test cases for controlled fields reset
  • Figure out a way, or document the limitations of clearing controlled fields
@kettanaito kettanaito added enhancement Enhances existing functionality. scope:architecture Changes affect architecture. labels Sep 5, 2018
@kettanaito kettanaito added this to the 1.x milestone Sep 5, 2018
@kettanaito kettanaito changed the title Handle controlled fields clear Handle clearing of controlled fields Sep 5, 2018
@kettanaito
Copy link
Owner Author

Needs to be verified the issue relevance by introducing a respective integration test branch.

@kettanaito kettanaito added the good first issue Good for newcomers. label Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhances existing functionality. good first issue Good for newcomers. needs:clarification needs:testing scope:architecture Changes affect architecture.
Projects
None yet
Development

No branches or pull requests

1 participant