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 {
99 this . state = { } ;
1010 }
1111
12+ shouldComponentUpdate ( ) {
13+ // don't terminate closing animation
14+ return ! this . props . ctx . _isMenuClosing ;
15+ }
16+
1217 render ( ) {
1318 const { ctx, backdropStyles } = this . props ;
1419 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 {
1919 constructor ( props ) {
2020 super ( props ) ;
2121 this . _menuRegistry = makeMenuRegistry ( ) ;
22+ this . _isMenuClosing = false ;
2223 }
2324
2425 getChildContext ( ) {
@@ -115,7 +116,15 @@ export default class MenuProvider extends Component {
115116 && this . optionsRef . close ( ) ) || Promise . resolve ( ) ;
116117 const hideBackdrop = this . backdropRef && this . backdropRef . close ( ) ;
117118 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+ } )
119128 }
120129
121130 toggleMenu ( name ) {
You can’t perform that action at this time.
0 commit comments