File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ export default class ModalPortal extends Component {
9898 }
9999
100100 componentWillUnmount ( ) {
101+ // Remove body class
102+ bodyClassList . remove ( this . props . bodyOpenClassName ) ;
101103 this . beforeClose ( ) ;
102104 clearTimeout ( this . closeTimer ) ;
103105 }
@@ -125,16 +127,16 @@ export default class ModalPortal extends Component {
125127 }
126128
127129 beforeClose ( ) {
128- const { appElement, ariaHideApp, bodyOpenClassName } = this . props ;
129- // Remove class if no more modals are open
130- bodyClassList . remove ( bodyOpenClassName ) ;
130+ const { appElement, ariaHideApp } = this . props ;
131131 // Reset aria-hidden attribute if all modals have been removed
132132 if ( ariaHideApp && refCount . totalCount ( ) < 1 ) {
133133 ariaAppHider . show ( appElement ) ;
134134 }
135135 }
136136
137137 afterClose = ( ) => {
138+ // Remove body class
139+ bodyClassList . remove ( this . props . bodyOpenClassName ) ;
138140 focusManager . returnFocus ( ) ;
139141 focusManager . teardownScopedFocus ( ) ;
140142 } ;
You can’t perform that action at this time.
0 commit comments