File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 4444 "dependencies" : {
4545 "detect-element-overflow" : " ^1.1.1" ,
4646 "get-user-locale" : " ^1.1.1" ,
47+ "make-event-props" : " ^1.1.0" ,
4748 "merge-class-names" : " ^1.1.1" ,
4849 "prop-types" : " ^15.6.0" ,
4950 "react-calendar" : " ^2.17.4" ,
Original file line number Diff line number Diff line change 11import React , { PureComponent } from 'react' ;
22import PropTypes from 'prop-types' ;
33import { polyfill } from 'react-lifecycles-compat' ;
4+ import makeEventProps from 'make-event-props' ;
45import mergeClassNames from 'merge-class-names' ;
56import detectElementOverflow from 'detect-element-overflow' ;
67
@@ -32,6 +33,10 @@ export default class DateTimePicker extends PureComponent {
3233
3334 state = { } ;
3435
36+ get eventProps ( ) {
37+ return makeEventProps ( this . props ) ;
38+ }
39+
3540 componentDidMount ( ) {
3641 document . addEventListener ( 'mousedown' , this . onClick ) ;
3742 }
@@ -81,7 +86,11 @@ export default class DateTimePicker extends PureComponent {
8186 }
8287
8388 onFocus = ( event ) => {
84- const { disabled } = this . props ;
89+ const { disabled, onFocus } = this . props ;
90+
91+ if ( onFocus ) {
92+ onFocus ( event ) ;
93+ }
8594
8695 // Internet Explorer still fires onFocus on disabled elements
8796 if ( disabled ) {
@@ -314,6 +323,7 @@ export default class DateTimePicker extends PureComponent {
314323 `${ baseClassName } --${ disabled ? 'disabled' : 'enabled' } ` ,
315324 className ,
316325 ) }
326+ { ...this . eventProps }
317327 onFocus = { this . onFocus }
318328 ref = { ( ref ) => { this . wrapper = ref ; } }
319329 >
You can’t perform that action at this time.
0 commit comments