File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 37
37
"test:watch" : " react-scripts test --env=jsdom" ,
38
38
"release" : " npm run test && npm run prepare && dotenv release-it" ,
39
39
"lint" : " eslint . --ext .js,.ts,.tsx" ,
40
- "format" : " prettier --write {src,playground}" ,
40
+ "format" : " prettier --write {src,playground}/**/*.{ts,tsx} " ,
41
41
"format:check" : " prettier --check {src,playground}/**/*.{ts,tsx}"
42
42
},
43
43
"peerDependencies" : {
93
93
" input" ,
94
94
" autocompletion"
95
95
]
96
- }
96
+ }
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ export interface ReactInputVerificationCodeProps {
23
23
const ReactInputVerificationCode = ( {
24
24
autoFocus = false ,
25
25
length = 4 ,
26
- onChange = ( ) => { } ,
27
- onCompleted = ( ) => { } ,
26
+ onChange = ( ) => { } ,
27
+ onCompleted = ( ) => { } ,
28
28
placeholder = '·' ,
29
29
value : pValue ,
30
30
dataCy = 'verification-code' ,
@@ -156,7 +156,8 @@ const ReactInputVerificationCode = ({
156
156
const stringValue = value . join ( '' ) ;
157
157
const isCompleted = stringValue . length === length ;
158
158
159
- if ( isCompleted && stringValue !== emptyValue . join ( '' ) ) onCompleted ( stringValue ) ;
159
+ if ( isCompleted && stringValue !== emptyValue . join ( '' ) )
160
+ onCompleted ( stringValue ) ;
160
161
onChange ( stringValue ) ;
161
162
} , [ value , length ] ) ;
162
163
@@ -208,8 +209,9 @@ const ReactInputVerificationCode = ({
208
209
ref = { ref }
209
210
role = 'button'
210
211
tabIndex = { 0 }
211
- className = { `ReactInputVerificationCode__item ${ value [ i ] !== placeholder ? 'is-filled' : ''
212
- } ${ i === activeIndex ? 'is-active' : '' } `}
212
+ className = { `ReactInputVerificationCode__item ${
213
+ value [ i ] !== placeholder ? 'is-filled' : ''
214
+ } ${ i === activeIndex ? 'is-active' : '' } `}
213
215
onFocus = { onItemFocus ( i ) }
214
216
data-cy = { `${ dataCy } -${ i } -item` }
215
217
>
You can’t perform that action at this time.
0 commit comments