Skip to content

Commit

Permalink
Fix: Stepper prevent content rendering if item disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rdig committed Nov 26, 2023
1 parent c1dcfb6 commit a50be33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/v5/shared/Stepper/Stepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function Stepper<TKey extends React.Key>({
const { decor, ...restHeading } = heading;
const isNextStepOptional = items[index + 1]?.isOptional;
const isNextStepSkipped = items[index + 1]?.isSkipped;
const itemDisabled = index > activeItemIndex || isSkipped;

return (
<motion.li
Expand Down Expand Up @@ -112,13 +113,13 @@ function Stepper<TKey extends React.Key>({
}
}}
className="relative z-[1]"
disabled={index > activeItemIndex || isSkipped}
disabled={itemDisabled}
isHighlighted={index === openItemIndex && !isSkipped}
{...restHeading}
/>
{decor || null}
</div>
{!isMobile && (
{!isMobile && !itemDisabled && (
<div
className={clsx(
'grid transition-[grid-template-rows_0.5s_ease-in-out] w-full',
Expand Down

0 comments on commit a50be33

Please sign in to comment.