Commit bd6b6be 潕量
authored
1 parent be38adb commit bd6b6be Copy full SHA for bd6b6be
File tree 1 file changed +4
-10
lines changed
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function preventDefault(e) {
9
9
}
10
10
export default class Password extends Input {
11
11
state = {
12
- hint : 'eye' ,
12
+ hint : 'eye-close ' ,
13
13
htmlType : 'password' ,
14
14
} ;
15
15
@@ -30,10 +30,10 @@ export default class Password extends Input {
30
30
toggleEye = e => {
31
31
e . preventDefault ( ) ;
32
32
33
- const eyeClose = this . state . hint === 'eye-close ' ;
33
+ const eyeClose = this . state . hint === 'eye' ;
34
34
35
35
this . setState ( {
36
- hint : eyeClose ? 'eye' : 'eye-close ' ,
36
+ hint : eyeClose ? 'eye-close ' : 'eye' ,
37
37
htmlType : eyeClose || ! this . props . showToggle ? 'password' : 'text' ,
38
38
} ) ;
39
39
} ;
@@ -42,13 +42,7 @@ export default class Password extends Input {
42
42
const { showToggle, ...others } = this . props ;
43
43
const { hint, htmlType } = this . state ;
44
44
45
- const extra = showToggle ? (
46
- < Icon
47
- type = { hint }
48
- onClick = { this . toggleEye }
49
- onMouseDown = { preventDefault }
50
- />
51
- ) : null ;
45
+ const extra = showToggle ? < Icon type = { hint } onClick = { this . toggleEye } onMouseDown = { preventDefault } /> : null ;
52
46
53
47
return < Input { ...others } extra = { extra } htmlType = { htmlType } /> ;
54
48
}
You can’t perform that action at this time.
0 commit comments