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 @@ -22,13 +22,15 @@ export default class DatePicker extends Component {
22
22
removable : PropTypes . bool ,
23
23
timePickerComponent : PropTypes . func ,
24
24
calendarStyles : PropTypes . object ,
25
- calendarContainerProps : PropTypes . object
25
+ calendarContainerProps : PropTypes . object ,
26
+ closeOnSelect : PropTypes . bool
26
27
} ;
27
28
28
29
static defaultProps = {
29
30
inputFormat : 'jYYYY/jM/jD' ,
30
31
calendarStyles : require ( '../styles/basic.css' ) ,
31
- calendarContainerProps : { }
32
+ calendarContainerProps : { } ,
33
+ closeOnSelect : false
32
34
} ;
33
35
34
36
state = {
@@ -99,6 +101,7 @@ export default class DatePicker extends Component {
99
101
}
100
102
101
103
this . setMomentValue ( momentValue ) ;
104
+ this . setState ( { isOpen : ! this . props . closeOnSelect } )
102
105
}
103
106
104
107
handleInputChange ( event ) {
You can’t perform that action at this time.
0 commit comments