@@ -96,11 +96,15 @@ class Dialog extends React.Component {
9696
9797 componentDidMount ( ) {
9898 this . setState ( { open : false } , ( ) => {
99- // make sure state is false first before opening the dialog
100- // to ensure opening is animated
101- setTimeout ( ( ) => {
99+ if ( this . props . animate === false ) {
102100 this . setState ( { open : true } ) ;
103- } , 10 ) ;
101+ } else {
102+ // make sure state is false first before opening the dialog
103+ // to ensure opening is animated
104+ setTimeout ( ( ) => {
105+ this . setState ( { open : true } ) ;
106+ } , 10 ) ;
107+ }
104108 } ) ;
105109 this . props . document . addEventListener ( 'keydown' , this . handler , true ) ;
106110 }
@@ -113,10 +117,10 @@ class Dialog extends React.Component {
113117 const classNames = [ 'ReactDialog' , this . state . open ? 'ReactDialogOpen' : '' ] ;
114118 const style = ReactDialogStyle ( { background : this . props . background } ) ;
115119 return (
116- React . createElement ( 'div' , { key : this . props . dialogKey , className : classNames . join ( ' ' ) , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 55 } }
117- , React . createElement ( 'style' , { __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 56 } } , style )
118- , React . createElement ( 'div' , { className : "ReactDialogInner" , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 57 } }
119- , React . createElement ( 'div' , { className : "ReactDialogBackground" , onClick : this . onClickBackground . bind ( this ) , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 58 } } )
120+ React . createElement ( 'div' , { key : this . props . dialogKey , className : classNames . join ( ' ' ) , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 59 } }
121+ , React . createElement ( 'style' , { __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 60 } } , style )
122+ , React . createElement ( 'div' , { className : "ReactDialogInner" , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 61 } }
123+ , React . createElement ( 'div' , { className : "ReactDialogBackground" , onClick : this . onClickBackground . bind ( this ) , __self : this , __source : { fileName : _jsxFileName$1 , lineNumber : 62 } } )
120124 , this . props . children
121125 )
122126 )
@@ -153,7 +157,8 @@ class ReactDialog extends React.Component {
153157 background : this . props . background ,
154158 close : this . props . close ,
155159 document : _document ,
156- open : this . props . open , __self : this , __source : { fileName : _jsxFileName , lineNumber : 29 } }
160+ open : this . props . open ,
161+ animate : this . props . animate , __self : this , __source : { fileName : _jsxFileName , lineNumber : 29 } }
157162
158163 , this . props . children
159164 ) ,
0 commit comments