Skip to content

Commit

Permalink
fix(lib): onClick is not updating currentStep if step is disabled rai…
Browse files Browse the repository at this point in the history
  • Loading branch information
kevenleone committed Jun 11, 2023
1 parent 2750ad4 commit 396b4f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/headless-stepper/src/lib/hooks/useStepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ const useStepper = ({
'aria-current': index === _currentStep ? 'step' : undefined,
'aria-selected': index === _currentStep,
onKeyDown: (event) => handleKeydown(event, index),
onClick: () => setCurrentStep(index),
onClick: () => (step.disabled ? null : setCurrentStep(index)),
ref: (element: HTMLElement) =>
(stepElementsRef.current[index] = element),
} as HTMLAttributes<HTMLElement>;
Expand Down

0 comments on commit 396b4f2

Please sign in to comment.