File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -28,9 +28,7 @@ class Demo extends React.Component {
28
28
visible: true
29
29
});
30
30
};
31
- onClose = reason => {
32
- console .log (reason);
33
-
31
+ onClose = () => {
34
32
this .setState ({
35
33
visible: false
36
34
});
@@ -44,6 +42,7 @@ class Demo extends React.Component {
44
42
< Dialog
45
43
title= " Welcome to Alibaba.com"
46
44
visible= {this .state .visible }
45
+ autoFocus
47
46
onOk= {this .onClose .bind (this , ' okClick' )}
48
47
onCancel= {this .onClose .bind (this , ' cancelClick' )}
49
48
onClose= {this .onClose }
Original file line number Diff line number Diff line change @@ -21,24 +21,20 @@ import { Overlay } from '@alifd/next';
21
21
class Demo extends React .Component {
22
22
constructor (props ) {
23
23
super (props);
24
-
25
24
this .state = {
26
25
visible: false
27
26
};
28
- }
29
-
27
+ };
30
28
onClick = () => {
31
29
this .setState ({
32
30
visible: ! this .state .visible
33
31
});
34
- }
35
-
32
+ };
36
33
onClose = () => {
37
34
this .setState ({
38
35
visible: false
39
36
});
40
- }
41
-
37
+ };
42
38
render () {
43
39
return (
44
40
< div>
@@ -48,6 +44,7 @@ class Demo extends React.Component {
48
44
overlay accessibility
49
45
< / button>
50
46
< Overlay visible= {this .state .visible }
47
+ autoFocus
51
48
target= {() => this .btn }
52
49
safeNode= {() => this .btn }
53
50
onRequestClose= {this .onClose }>
You can’t perform that action at this time.
0 commit comments