@@ -11,7 +11,9 @@ class Dropdown extends React.Component {
1111 disabled : React . PropTypes . bool ,
1212 error : React . PropTypes . string ,
1313 label : React . PropTypes . string ,
14+ onBlur : React . PropTypes . func ,
1415 onChange : React . PropTypes . func ,
16+ onFocus : React . PropTypes . func ,
1517 source : React . PropTypes . array . isRequired ,
1618 template : React . PropTypes . func ,
1719 value : React . PropTypes . string
@@ -33,10 +35,12 @@ class Dropdown extends React.Component {
3335 const client = event . target . getBoundingClientRect ( ) ;
3436 const screen_height = window . innerHeight || document . documentElement . offsetHeight ;
3537 const up = this . props . auto ? client . top > ( ( screen_height / 2 ) + client . height ) : false ;
38+ if ( this . props . onFocus ) this . props . onFocus ( ) ;
3639 this . setState ( { active : true , up} ) ;
3740 } ;
3841
3942 handleSelect = ( item , event ) => {
43+ if ( this . props . onBlur ) this . props . onBlur ( ) ;
4044 if ( ! this . props . disabled && this . props . onChange ) {
4145 this . props . onChange ( item , event ) ;
4246 this . setState ( { active : false } ) ;
0 commit comments