@@ -36,6 +36,7 @@ class DatePicker extends Component {
36
36
this . onPressDate = this . onPressDate . bind ( this ) ;
37
37
this . onPressCancel = this . onPressCancel . bind ( this ) ;
38
38
this . onPressConfirm = this . onPressConfirm . bind ( this ) ;
39
+ this . onPressMask = this . onPressMask . bind ( this ) ;
39
40
this . onDatePicked = this . onDatePicked . bind ( this ) ;
40
41
this . onTimePicked = this . onTimePicked . bind ( this ) ;
41
42
this . onDatetimePicked = this . onDatetimePicked . bind ( this ) ;
@@ -91,6 +92,14 @@ class DatePicker extends Component {
91
92
return true ;
92
93
}
93
94
95
+ onPressMask ( ) {
96
+ if ( typeof this . props . onPressMask === 'function' ) {
97
+ this . props . onPressMask ( ) ;
98
+ } else {
99
+ this . onPressCancel ( ) ;
100
+ }
101
+ }
102
+
94
103
onPressCancel ( ) {
95
104
this . setModalVisible ( false ) ;
96
105
@@ -336,7 +345,7 @@ class DatePicker extends Component {
336
345
style = { Style . datePickerMask }
337
346
activeOpacity = { 1 }
338
347
underlayColor = { '#00000077' }
339
- onPress = { this . onPressCancel }
348
+ onPress = { this . onPressMask }
340
349
>
341
350
< TouchableHighlight
342
351
underlayColor = { '#fff' }
@@ -424,6 +433,7 @@ DatePicker.propTypes = {
424
433
onDateChange : React . PropTypes . func ,
425
434
onOpenModal : React . PropTypes . func ,
426
435
onCloseModal : React . PropTypes . func ,
436
+ onPressMask : React . PropTypes . func ,
427
437
placeholder : React . PropTypes . string ,
428
438
modalOnResponderTerminationRequest : React . PropTypes . func ,
429
439
is24Hour : React . PropTypes . bool
0 commit comments