22var babelHelpers = require ( "./util/babelHelpers.js" ) ;
33var React = require ( "react" ) ,
44 invariant = require ( "react/lib/invariant" ) ,
5+ activeElement = require ( "react/lib/getActiveElement" ) ,
56 cx = require ( "classnames" ) ,
67 compat = require ( "./util/compat" ) ,
78 _ = require ( "./util/_" ) //pick, omit, has
@@ -139,6 +140,7 @@ var DateTimePicker = React.createClass({
139140 return _cx ;
140141 } ) ( ) ) } ) ,
141142 React . createElement ( DateInput , { ref : "valueInput" ,
143+ "aria-labelledby" : this . props [ "aria-labelledby" ] ,
142144 "aria-activedescendant" : this . props . open ? this . props . open === popups . CALENDAR ? this . _id ( "_cal_view_selected_item" ) : timeOptID : undefined ,
143145 "aria-expanded" : ! ! this . props . open ,
144146 "aria-busy" : ! ! this . props . busy ,
@@ -201,7 +203,10 @@ var DateTimePicker = React.createClass({
201203 {
202204 dropUp : dropUp ,
203205 open : this . props . open === popups . TIME ,
204- onRequestClose : this . close } ,
206+ onRequestClose : this . close ,
207+ onOpening : function ( ) {
208+ return _this . refs . timePopup . forceUpdate ( ) ;
209+ } } ,
205210 React . createElement (
206211 "div" ,
207212 null ,
@@ -211,6 +216,7 @@ var DateTimePicker = React.createClass({
211216 "aria-hidden" : ! this . props . open ,
212217 style : { maxHeight : 200 , height : "auto" } ,
213218 value : value ,
219+ step : this . props . step ,
214220 min : this . props . min ,
215221 max : this . props . max ,
216222 culture : this . props . culture ,
@@ -249,6 +255,8 @@ var DateTimePicker = React.createClass({
249255 if ( date != this . props . value ) change ( date , str ) ;
250256 } else if ( ! dates . eq ( date , this . props . value ) ) change ( date , str ) ;
251257 }
258+
259+ //this._focus(true)
252260 } ,
253261
254262 _keyDown : function ( e ) {
@@ -268,14 +276,14 @@ var DateTimePicker = React.createClass({
268276 } ,
269277
270278 //timeout prevents transitions from breaking focus
271- _focus : function ( focused , e ) {
279+ _focus : function ( focused , isOnFocusEvent , e ) {
272280 var _this = this ;
273281
274- var input = this . refs . valueInput ;
282+ var inputFocused = activeElement ( ) === this . refs . valueInput . getDOMNode ( ) ;
275283
276284 this . setTimeout ( "focus" , function ( ) {
277-
278- if ( focused ) compat . findDOMNode ( input ) . focus ( ) ; else _this . close ( ) ;
285+ //var el = this.refs.valueInput
286+ if ( focused ) _this . refs . valueInput . focus ( ) ; else _this . close ( ) ;
279287
280288 if ( focused !== _this . state . focused ) {
281289 _this . notify ( focused ? "onFocus" : "onBlur" , e ) ;
0 commit comments