@@ -10,13 +10,13 @@ export class Dropdown extends Component {
1010 super ( props ) ;
1111
1212 this . state = {
13- show : false ,
13+ show : undefined ,
1414 } ;
1515 }
1616
1717 onBlur ( e ) {
18- // if (this.state.show === true)
19- // this.setState({show: false});
18+ if ( this . state . show === true )
19+ this . setState ( { show : false } ) ;
2020 }
2121
2222 render ( ) {
@@ -25,18 +25,16 @@ export class Dropdown extends Component {
2525 {
2626 < Button
2727 { ...this . props . buttonProps }
28- onClick = { ( ) => this . setState ( { show : ! this . state . show } ) } />
28+ onClick = { ( ) => this . setState ( { show : ! this . state . show } ) } />
2929 }
30- {
31- this . state . show &&
32- < div
33- className = {
34- classNames (
35- 'rce-dropdown' ,
36- this . props . animationType ,
37- 'rce-dropdown-open__' + this . props . animationPosition ,
38- )
39- } >
30+ < div
31+ className = { classNames (
32+ 'rce-dropdown' ,
33+ this . props . animationType ,
34+ 'rce-dropdown-open__' + this . props . animationPosition ,
35+ { 'dropdown-hide' : this . state . show === false } ,
36+ { 'dropdown-show' : this . state . show === true } ) } >
37+
4038 < ul >
4139 {
4240 this . props . items . map ( ( x , i ) => (
@@ -46,16 +44,15 @@ export class Dropdown extends Component {
4644 ) )
4745 }
4846 </ ul >
49- </ div >
50- }
47+ </ div >
5148 </ div >
5249 ) ;
5350 }
5451}
5552
5653Dropdown . defaultProps = {
5754 animationType : 'default' ,
58- animationPosition : 'nortwest ' ,
55+ animationPosition : 'southwest ' ,
5956 items : [ ] ,
6057 onSelect : Function ,
6158 buttonProps : null
0 commit comments