File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
src/components/molecules/Steps Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ const Step: FC<IStepProps> = (props) => {
130130 className = { classNames ( "steps__step" , {
131131 steps__step_disabled : disabled && ! error && ! loading ,
132132 steps__step_error : error ,
133- steps__step_success : complete && state !== "next" ,
133+ steps__step_success : complete ,
134134 steps__step_current : state === "current"
135135 } ) }
136136 >
Original file line number Diff line number Diff line change @@ -166,11 +166,7 @@ const StepsWizardTemplate: FC<IStepsProps> = (props) => {
166166 . filter ( ( item ) => item !== null ) ;
167167
168168 const isStepEnabled = ( ) =>
169- stepsData . map ( ( item , index ) =>
170- item . touched || stepsData [ index - 1 ] ?. touched || stepsData [ index - 1 ] ?. complete || index === 0
171- ? index
172- : null
173- ) ;
169+ stepsData . map ( ( item , index ) => ( item . touched || stepsData [ index - 1 ] ?. complete || index === 0 ? index : null ) ) ;
174170
175171 return (
176172 < >
@@ -191,7 +187,8 @@ const StepsWizardTemplate: FC<IStepsProps> = (props) => {
191187 onClick : nextButtonHandler ,
192188 disabled :
193189 ( ! isStepEnabled ( ) . includes ( currentStep + 1 ) && ! isLastStep ) ||
194- ( isLastStep && getErrorStepIndices ( ) . length > 0 )
190+ ( isLastStep && getErrorStepIndices ( ) . length > 0 ) ||
191+ ( isLastStep && ! stepsData [ stepsData . length - 1 ] . complete )
195192 }
196193 ] }
197194 footerContent = {
@@ -210,7 +207,7 @@ const StepsWizardTemplate: FC<IStepsProps> = (props) => {
210207 label = { step . label }
211208 description = { step . description }
212209 disabled = { ! isStepEnabled ( ) . includes ( index ) }
213- error = { getErrorStepIndices ( ) . includes ( index ) && index !== stepsData . length - 1 }
210+ error = { getErrorStepIndices ( ) . includes ( index ) }
214211 complete = { step . complete }
215212 />
216213 ) ;
You can’t perform that action at this time.
0 commit comments