diff --git a/components/lib/stepper/Stepper.js b/components/lib/stepper/Stepper.js index 5e85e7439d..430b46e7a1 100644 --- a/components/lib/stepper/Stepper.js +++ b/components/lib/stepper/Stepper.js @@ -165,6 +165,8 @@ export const Stepper = React.memo( React.useImperativeHandle(ref, () => ({ getElement: () => navRef.current, + getActiveStep: () => activeStepState, + setActiveStep: (step) => setActiveStepState(step), nextCallback: (e) => nextCallback(e, activeStepState), prevCallback: (e) => prevCallback(e, activeStepState) })); diff --git a/components/lib/stepper/stepper.d.ts b/components/lib/stepper/stepper.d.ts index 0969821245..4d728d6e72 100644 --- a/components/lib/stepper/stepper.d.ts +++ b/components/lib/stepper/stepper.d.ts @@ -84,9 +84,12 @@ export interface StepperChangeEvent { /** * Defines custom RefAttributes methods + * @group Methods */ export interface StepperRefAttributes { getElement: () => HTMLDivElement; + getActiveStep: () => number | undefined; + setActiveStep: (step: number) => void; nextCallback: (e?: React.SyntheticEvent) => void; prevCallback: (e?: React.SyntheticEvent) => void; }