@@ -88,7 +88,11 @@ var Calendar = _react2.default.createClass({
88
88
displayDate : _react2 . default . PropTypes . object . isRequired ,
89
89
onChange : _react2 . default . PropTypes . func . isRequired ,
90
90
dayLabels : _react2 . default . PropTypes . array . isRequired ,
91
- cellPadding : _react2 . default . PropTypes . string . isRequired
91
+ cellPadding : _react2 . default . PropTypes . string . isRequired ,
92
+ onUnmount : _react2 . default . PropTypes . func . isRequired
93
+ } ,
94
+ componentWillUnmount : function componentWillUnmount ( ) {
95
+ this . props . onUnmount ( ) ;
92
96
} ,
93
97
handleClick : function handleClick ( day ) {
94
98
var newSelectedDate = new Date ( this . props . displayDate ) ;
@@ -232,7 +236,21 @@ exports.default = _react2.default.createClass({
232
236
this . props . valueLink . requestChange ( null ) ;
233
237
}
234
238
} ,
239
+ handleHide : function handleHide ( e ) {
240
+ if ( document . activeElement === this . refs . input . getInputDOMNode ( ) ) {
241
+ return ;
242
+ }
243
+ this . setState ( {
244
+ focused : false
245
+ } ) ;
246
+ if ( this . props . onBlur ) {
247
+ this . props . onBlur ( e ) ;
248
+ }
249
+ } ,
235
250
handleFocus : function handleFocus ( e ) {
251
+ if ( this . refs . overlay . state . isOverlayShown === true ) {
252
+ return ;
253
+ }
236
254
this . setState ( {
237
255
focused : true
238
256
} ) ;
@@ -241,6 +259,9 @@ exports.default = _react2.default.createClass({
241
259
}
242
260
} ,
243
261
handleBlur : function handleBlur ( e ) {
262
+ if ( this . refs . overlay . state . isOverlayShown === true ) {
263
+ return ;
264
+ }
244
265
this . setState ( {
245
266
focused : false
246
267
} ) ;
@@ -329,7 +350,7 @@ exports.default = _react2.default.createClass({
329
350
var popOver = _react2 . default . createElement (
330
351
_Popover2 . default ,
331
352
{ id : 'calendar' , title : calendarHeader } ,
332
- _react2 . default . createElement ( Calendar , { cellPadding : this . props . cellPadding , selectedDate : this . state . selectedDate , displayDate : this . state . displayDate , onChange : this . onChangeDate , dayLabels : this . props . dayLabels } )
353
+ _react2 . default . createElement ( Calendar , { cellPadding : this . props . cellPadding , selectedDate : this . state . selectedDate , displayDate : this . state . displayDate , onChange : this . onChangeDate , dayLabels : this . props . dayLabels , onUnmount : this . handleHide } )
333
354
) ;
334
355
var buttonStyle = this . props . bsStyle === "error" ? "danger" : this . props . bsStyle ;
335
356
var clearButton = _react2 . default . createElement (
0 commit comments