Skip to content

Commit

Permalink
Fix primefaces#6475: Stepper add get/set active step
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 26, 2024
1 parent fb010b6 commit fe151ef
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 fe151ef

Please sign in to comment.