File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ module.exports = React.createClass({
46
46
47
47
getInitialState ( ) {
48
48
return {
49
+ initialRender : true ,
49
50
status : this . props . open ? OPENING : CLOSED
50
51
}
51
52
} ,
@@ -68,9 +69,14 @@ module.exports = React.createClass({
68
69
} ,
69
70
70
71
componentDidMount ( ) {
71
- if ( this . state . status === OPENING ) {
72
- this . open ( ) ;
73
- }
72
+ let isOpen = this . state . status === OPENING ;
73
+
74
+ compat . batchedUpdates ( ( ) => {
75
+ this . setState ( { initialRender : false } )
76
+ if ( isOpen ) {
77
+ this . open ( ) ;
78
+ }
79
+ } )
74
80
} ,
75
81
76
82
componentDidUpdate ( pvProps ) {
@@ -170,7 +176,10 @@ module.exports = React.createClass({
170
176
} )
171
177
} ,
172
178
173
- getOffsetForStatus ( status ) {
179
+ getOffsetForStatus ( status ) {
180
+ if ( this . state . initialRender )
181
+ return { }
182
+
174
183
let _in = properties ( 'top' , this . props . dropUp ? '100%' : '-100%' )
175
184
, out = properties ( 'top' , 0 )
176
185
return {
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ module.exports = {
11
11
12
12
findDOMNode ( component ) {
13
13
return ReactDOM . findDOMNode ( component )
14
- }
14
+ } ,
15
15
16
+ batchedUpdates ( cb ) {
17
+ ReactDOM . unstable_batchedUpdates ( cb )
18
+ }
16
19
}
You can’t perform that action at this time.
0 commit comments