File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,11 @@ export default class MenuPlaceholder extends Component {
9
9
this . state = { } ;
10
10
}
11
11
12
+ shouldComponentUpdate ( ) {
13
+ // don't terminate closing animation
14
+ return ! this . props . ctx . _isMenuClosing ;
15
+ }
16
+
12
17
render ( ) {
13
18
const { ctx, backdropStyles } = this . props ;
14
19
const shouldRenderMenu = ctx . isMenuOpen ( ) && ctx . _isInitialized ( ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ export default class MenuProvider extends Component {
19
19
constructor ( props ) {
20
20
super ( props ) ;
21
21
this . _menuRegistry = makeMenuRegistry ( ) ;
22
+ this . _isMenuClosing = false ;
22
23
}
23
24
24
25
getChildContext ( ) {
@@ -115,7 +116,15 @@ export default class MenuProvider extends Component {
115
116
&& this . optionsRef . close ( ) ) || Promise . resolve ( ) ;
116
117
const hideBackdrop = this . backdropRef && this . backdropRef . close ( ) ;
117
118
this . _invalidateTriggerLayouts ( ) ;
118
- return Promise . all ( [ hideMenu , hideBackdrop ] ) ;
119
+ this . _isMenuClosing = true ;
120
+ return Promise . all ( [ hideMenu , hideBackdrop ] )
121
+ . then ( ( ) => {
122
+ this . _isMenuClosing = false ;
123
+ } )
124
+ . catch ( err => {
125
+ this . _isMenuClosing = false ;
126
+ throw err ;
127
+ } )
119
128
}
120
129
121
130
toggleMenu ( name ) {
You can’t perform that action at this time.
0 commit comments