File tree 4 files changed +14
-2
lines changed
4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ const App = React.createClass({
68
68
< Col sm = { 6 } >
69
69
< FormGroup >
70
70
< ControlLabel > { this . state . focused ? "Focused" : "Blurred" } </ ControlLabel >
71
- < DatePicker placeholder = "Placeholder" value = { this . state . date } onFocus = { ( ) => { this . setState ( { focused : true } ) } } onBlur = { ( ) => { this . setState ( { focused : false } ) } } />
71
+ < DatePicker onChange = { this . handleChange } placeholder = "Placeholder" value = { this . state . date } onFocus = { ( ) => { this . setState ( { focused : true } ) } } onBlur = { ( ) => { this . setState ( { focused : false } ) } } />
72
72
< HelpBlock > This is { this . state . focused ? "focused" : "blurred" } .</ HelpBlock >
73
73
</ FormGroup >
74
74
</ Col >
Original file line number Diff line number Diff line change @@ -255,6 +255,9 @@ exports.default = _react2.default.createClass({
255
255
this . setState ( {
256
256
focused : false
257
257
} ) ;
258
+ if ( this . props . onBlur ) {
259
+ this . props . onBlur ( e ) ;
260
+ }
258
261
}
259
262
} ,
260
263
handleFocus : function handleFocus ( e ) {
@@ -381,6 +384,9 @@ exports.default = _react2.default.createClass({
381
384
value : newSelectedDate . toISOString ( ) ,
382
385
focused : false
383
386
} ) ;
387
+ if ( this . props . onBlur ) {
388
+ this . props . onBlur ( new Event ( "Change Date" ) ) ;
389
+ }
384
390
if ( this . props . onChange ) {
385
391
this . props . onChange ( newSelectedDate . toISOString ( ) ) ;
386
392
}
Original file line number Diff line number Diff line change 11
11
" picker"
12
12
],
13
13
"main" : " lib/index.js" ,
14
- "version" : " 3.0.2 " ,
14
+ "version" : " 3.0.3 " ,
15
15
"description" : " React-Bootstrap based date picker." ,
16
16
"directories" : {
17
17
"test" : " test"
Original file line number Diff line number Diff line change @@ -206,6 +206,9 @@ export default React.createClass({
206
206
this . setState ( {
207
207
focused : false
208
208
} ) ;
209
+ if ( this . props . onBlur ) {
210
+ this . props . onBlur ( e ) ;
211
+ }
209
212
}
210
213
} ,
211
214
handleFocus ( e ) {
@@ -329,6 +332,9 @@ export default React.createClass({
329
332
value : newSelectedDate . toISOString ( ) ,
330
333
focused : false
331
334
} ) ;
335
+ if ( this . props . onBlur ) {
336
+ this . props . onBlur ( new Event ( "Change Date" ) ) ;
337
+ }
332
338
if ( this . props . onChange ) {
333
339
this . props . onChange ( newSelectedDate . toISOString ( ) ) ;
334
340
}
You can’t perform that action at this time.
0 commit comments