Skip to content

Commit

Permalink
Fix #6475: Stepper add get/set active step (#6486)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Apr 29, 2024
1 parent b3d109a commit 38b891c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions components/lib/stepper/Stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}));
Expand Down
3 changes: 3 additions & 0 deletions components/lib/stepper/stepper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 38b891c

Please sign in to comment.