File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ export interface ReactInputVerificationCodeProps {
2323const ReactInputVerificationCode = ( {
2424 autoFocus = false ,
2525 length = 4 ,
26- onChange = ( ) => { } ,
27- onCompleted = ( ) => { } ,
26+ onChange = ( ) => { } ,
27+ onCompleted = ( ) => { } ,
2828 placeholder = '·' ,
2929 value : pValue ,
3030 dataCy = 'verification-code' ,
@@ -156,7 +156,7 @@ const ReactInputVerificationCode = ({
156156 const stringValue = value . join ( '' ) ;
157157 const isCompleted = stringValue . length === length ;
158158
159- if ( isCompleted ) onCompleted ( stringValue ) ;
159+ if ( isCompleted && stringValue !== emptyValue . join ( '' ) ) onCompleted ( stringValue ) ;
160160 onChange ( stringValue ) ;
161161 } , [ value , length ] ) ;
162162
@@ -208,9 +208,8 @@ const ReactInputVerificationCode = ({
208208 ref = { ref }
209209 role = 'button'
210210 tabIndex = { 0 }
211- className = { `ReactInputVerificationCode__item ${
212- value [ i ] !== placeholder ? 'is-filled' : ''
213- } ${ i === activeIndex ? 'is-active' : '' } `}
211+ className = { `ReactInputVerificationCode__item ${ value [ i ] !== placeholder ? 'is-filled' : ''
212+ } ${ i === activeIndex ? 'is-active' : '' } `}
214213 onFocus = { onItemFocus ( i ) }
215214 data-cy = { `${ dataCy } -${ i } -item` }
216215 >
You can’t perform that action at this time.
0 commit comments