File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,13 @@ export default class App extends Component {
48
48
< DatePicker />
49
49
</ Example >
50
50
</ div >
51
+ < div >
52
+ < Example
53
+ title = "ورودی تاریخ ساده بسته شدن خودکار"
54
+ code = { basicAutoDatePickerCode } >
55
+ < DatePicker closeOnSelect />
56
+ </ Example >
57
+ </ div >
51
58
< div >
52
59
< Example
53
60
title = "ورود تاریخ کنترل شده"
@@ -119,6 +126,10 @@ const basicDatePickerCode = `render() {
119
126
return <DatePicker />;
120
127
}` ;
121
128
129
+ const basicAutoDatePickerCode = `render() {
130
+ return <DatePicker closeOnSelect/>;
131
+ }` ;
132
+
122
133
123
134
const clearDatePickerCode = `render() {
124
135
return (
Original file line number Diff line number Diff line change @@ -21,13 +21,15 @@ export default class DatePicker extends Component {
21
21
removable : PropTypes . bool ,
22
22
timePickerComponent : PropTypes . func ,
23
23
calendarStyles : PropTypes . object ,
24
- calendarContainerProps : PropTypes . object
24
+ calendarContainerProps : PropTypes . object ,
25
+ closeOnSelect : PropTypes . bool
25
26
} ;
26
27
27
28
static defaultProps = {
28
29
inputFormat : 'jYYYY/jM/jD' ,
29
30
calendarStyles : require ( '../styles/basic.css' ) ,
30
- calendarContainerProps : { }
31
+ calendarContainerProps : { } ,
32
+ closeOnSelect : false
31
33
} ;
32
34
33
35
state = {
@@ -98,6 +100,7 @@ export default class DatePicker extends Component {
98
100
}
99
101
100
102
this . setMomentValue ( momentValue ) ;
103
+ this . setState ( { isOpen : ! this . props . closeOnSelect } )
101
104
}
102
105
103
106
handleInputChange ( event ) {
You can’t perform that action at this time.
0 commit comments