File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 61
61
"prop-types" : " 15.x" ,
62
62
"rc-align" : " 2.x" ,
63
63
"rc-animate" : " 2.x" ,
64
- "rc-util" : " ^4.1 .0"
64
+ "rc-util" : " ^4.2 .0"
65
65
}
66
66
}
Original file line number Diff line number Diff line change @@ -126,6 +126,9 @@ const Trigger = createReactClass({
126
126
} else {
127
127
popupVisible = ! ! props . defaultPopupVisible ;
128
128
}
129
+
130
+ this . prevPopupVisible = popupVisible ;
131
+
129
132
return {
130
133
popupVisible,
131
134
} ;
@@ -163,10 +166,10 @@ const Trigger = createReactClass({
163
166
} ;
164
167
if ( ! IS_REACT_16 ) {
165
168
this . renderComponent ( null , triggerAfterPopupVisibleChange ) ;
166
- } else {
167
- triggerAfterPopupVisibleChange ( ) ;
168
169
}
169
170
171
+ this . prevPopupVisible = prevState . popupVisible ;
172
+
170
173
// We must listen to `mousedown`, edge case:
171
174
// https://github.com/ant-design/ant-design/issues/5804
172
175
// https://github.com/react-component/calendar/issues/250
@@ -313,6 +316,12 @@ const Trigger = createReactClass({
313
316
}
314
317
} ,
315
318
319
+ handlePortalUpdate ( ) {
320
+ if ( this . prevPopupVisible !== this . state . popupVisible ) {
321
+ this . props . afterPopupVisibleChange ( this . state . popupVisible ) ;
322
+ }
323
+ } ,
324
+
316
325
getPopupDomNode ( ) {
317
326
// for test
318
327
if ( this . _component && this . _component . getPopupDomNode ) {
@@ -574,6 +583,7 @@ const Trigger = createReactClass({
574
583
< Portal
575
584
key = "portal"
576
585
getContainer = { this . getContainer }
586
+ didUpdate = { this . handlePortalUpdate }
577
587
>
578
588
{ this . getComponent ( ) }
579
589
</ Portal >
You can’t perform that action at this time.
0 commit comments