File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ var Modal = module.exports = React.createClass({
59
59
componentWillUnmount : function ( ) {
60
60
ReactDOM . unmountComponentAtNode ( this . node ) ;
61
61
AppElement . removeChild ( this . node ) ;
62
+ elementClass ( document . body ) . remove ( 'ReactModal__Body--open' ) ;
62
63
} ,
63
64
64
65
renderPortal : function ( props ) {
Original file line number Diff line number Diff line change @@ -175,6 +175,13 @@ describe('Modal', function () {
175
175
unmountModal ( ) ;
176
176
} ) ;
177
177
178
+ it ( 'removes class from body when unmounted without closing' , function ( ) {
179
+ var modal = renderModal ( { isOpen : true } ) ;
180
+ equal ( document . body . className . indexOf ( 'ReactModal__Body--open' ) !== - 1 , true ) ;
181
+ unmountModal ( ) ;
182
+ equal ( document . body . className . indexOf ( 'ReactModal__Body--open' ) !== - 1 , false ) ;
183
+ } ) ;
184
+
178
185
it ( 'adds --after-open for animations' , function ( ) {
179
186
var modal = renderModal ( { isOpen : true } ) ;
180
187
var overlay = document . querySelector ( '.ReactModal__Overlay' ) ;
You can’t perform that action at this time.
0 commit comments