Skip to content
New issue

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

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

Already on GitHub? # to your account

Wizard steps switch from invalid -> valid -> invalid #99

Open
andrewanderson58 opened this issue Apr 10, 2020 · 0 comments
Open

Wizard steps switch from invalid -> valid -> invalid #99

andrewanderson58 opened this issue Apr 10, 2020 · 0 comments

Comments

@andrewanderson58
Copy link
Contributor

Hello,

So I have been playing around with the wizard and I want to have forms on each step and only allow (next/finish) when the form is valid.

Right now I am doing the following. Calling the checkStepValidity when all fields are populated. But not sure how I could toggle it back to invalid if a field is completed but then erased.

  useEffect(() => {
    if (
      patient.firstName?.length > 0
    ) {
       wizardRef.current?.checkStepValidity(0);
    } else {
      // set step to invalid
    }
  }, [patient]);

Is there currently any way to do this or could you recommend a better way?

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

No branches or pull requests

1 participant