File tree Expand file tree Collapse file tree
packages/ui/src/features/loops/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -446,8 +446,8 @@ function Stepper({
446446 { STEPS . map ( ( label , index ) => {
447447 const isCurrent = index === current ;
448448 const isDone = index < current && complete [ index ] ;
449- // Steps navigate freely in both directions; skipping ahead is safe
450- // because Next stays gated per step and Create on the whole form.
449+ const canSelect =
450+ index <= current || complete . slice ( current , index ) . every ( Boolean ) ;
451451 return (
452452 < Flex
453453 key = { label }
@@ -456,8 +456,11 @@ function Stepper({
456456 >
457457 < button
458458 type = "button"
459- onClick = { ( ) => onSelect ( index ) }
460- className = "flex min-w-0 cursor-pointer items-center gap-2"
459+ disabled = { ! canSelect }
460+ onClick = { ( ) => {
461+ if ( canSelect ) onSelect ( index ) ;
462+ } }
463+ className = "flex min-w-0 cursor-pointer items-center gap-2 disabled:cursor-not-allowed disabled:opacity-50"
461464 >
462465 < Flex
463466 align = "center"
You can’t perform that action at this time.
0 commit comments