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

4.0 Refactoring useFieldState args, onValidSubmit, and isFormBusy #13

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

nathanb
Copy link
Contributor

@nathanb nathanb commented Mar 3, 2024

  • Changed useFieldState arguments to (fields, options)
  • Removed onValidSubmit from useFieldState to only FieldManager & ControlledFieldManager. (It's still on `ValidatedForm, but does not provide the field values).
  • Adding: isFormBusy and toggleFormBusy(state?: boolean) as a helper for DOM/styling during async submit handling.

Comment on lines -35 to -36
it('should setup validation form and not report any errors if form is valid', async () => {
render(<SampleFieldWithRenderError />, { wrapper: FullyControlledFieldWrapper })
Copy link
Contributor Author

@nathanb nathanb Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were more like integration tests. bleh... Mocked out the field manager, tested only the behavior of the FieldManagerForm itself.

@nathanb nathanb force-pushed the more-cleanup branch 4 times, most recently from 116e064 to 25a2fed Compare March 4, 2024 14:53
…d state props for isFormBusy, toggleFormBusy for managing custom styling/DOM state.
@nathanb nathanb merged commit b01000c into main Mar 4, 2024
1 check passed
@nathanb nathanb deleted the more-cleanup branch March 4, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant