File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class SemanticDatepicker extends React.Component {
26
26
clearable : PropTypes . bool ,
27
27
date : PropTypes . instanceOf ( Date ) ,
28
28
format : PropTypes . string ,
29
+ keepOpenOnClear : PropTypes . bool ,
29
30
locale : PropTypes . object ,
30
31
onDateChange : PropTypes . func . isRequired ,
31
32
placeholder : PropTypes . string ,
@@ -38,6 +39,7 @@ class SemanticDatepicker extends React.Component {
38
39
39
40
static defaultProps = {
40
41
clearable : true ,
42
+ keepOpenOnClear : false ,
41
43
date : undefined ,
42
44
format : 'YYYY-MM-DD' ,
43
45
locale : localeEn ,
@@ -94,9 +96,9 @@ class SemanticDatepicker extends React.Component {
94
96
Component = this . isRangeInput ? RangeDatePicker : BasicDatePicker ;
95
97
96
98
resetState = ( ) => {
97
- const { onDateChange } = this . props ;
99
+ const { keepOpenOnClear , onDateChange } = this . props ;
98
100
const newState = {
99
- isVisible : false ,
101
+ isVisible : keepOpenOnClear ,
100
102
selectedDate : this . isRangeInput ? [ ] : null ,
101
103
selectedDateFormatted : '' ,
102
104
} ;
You can’t perform that action at this time.
0 commit comments