From 4fc919b98e5c985f2f84ff61f6e91159a13009fc Mon Sep 17 00:00:00 2001 From: Julian Kniephoff Date: Tue, 4 Jun 2024 14:11:45 +0200 Subject: [PATCH] Harmonize disabling wizard stepper buttons across all instances --- src/components/shared/wizard/WizardStepperEvent.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/shared/wizard/WizardStepperEvent.tsx b/src/components/shared/wizard/WizardStepperEvent.tsx index d2b9058a13..e0db6086a7 100644 --- a/src/components/shared/wizard/WizardStepperEvent.tsx +++ b/src/components/shared/wizard/WizardStepperEvent.tsx @@ -8,11 +8,13 @@ import { useStepperStyle, } from "../../../utils/wizardUtils"; import CustomStepIcon from "./CustomStepIcon"; +import { FormikProps } from "formik"; const WizardStepperEvent = ({ steps, page, setPage, + formik, completed, } : { steps: { @@ -22,6 +24,7 @@ const WizardStepperEvent = ({ }[], page: number, setPage: (num: number) => void, + formik: FormikProps, completed: Record, }) => { const { t } = useTranslation(); @@ -50,6 +53,8 @@ const WizardStepperEvent = ({ } }; + const disabled = !(formik.dirty && formik.isValid); + return ( label.hidden || ( - handleOnClick(key)}> + handleOnClick(key)} disabled={disabled}> {t(label.translation)}