fix: clicking on previous step navigates to correct step instead of next (#22146)
* fix: clicking on previous step navigates to correct step instead of next * fix: implement step navigation in WizardForm and disable navigation in WizardLayout * fix: adjust step navigation logic in WizardForm and useWizardState * fix: add clarification comment in goToStep function --------- Co-authored-by: Kartik Saini <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
6 files changed
+18
-12
No files matched your search
@@ -125,6 +125,13 @@ const OnboardingPage = (props: PageProps) => {
|
||||
};
|
||||
const currentStepIndex = steps.indexOf(currentStep);
|
||||
|
||||
const goToStep = (step: number) => {
|
||||
const newStep = steps[step];
|
||||
startTransition(() => {
|
||||
router.push(`/getting-started/${stepTransform(newStep)}`);
|
||||
});
|
||||
};
|
||||
|
||||
const goToNextStep = () => {
|
||||
const nextIndex = currentStepIndex + 1;
|
||||
const newStep = steps[nextIndex];
|
||||
@@ -159,7 +166,7 @@ const OnboardingPage = (props: PageProps) => {
|
||||
</p>
|
||||
))}
|
||||
</header>
|
||||
<Steps maxSteps={steps.length} currentStep={currentStepIndex + 1} nextStep={goToNextStep} />
|
||||
<Steps maxSteps={steps.length} currentStep={currentStepIndex + 1} navigateToStep={goToStep} />
|
||||
</div>
|
||||
<StepCard>
|
||||
<Suspense fallback={<Icon name="loader" />}>
|
||||
|
||||
Reference in new issue
Block a user