diff --git a/lib/components/Modal.js b/lib/components/Modal.js index 0fb48f26..f4b79950 100644 --- a/lib/components/Modal.js +++ b/lib/components/Modal.js @@ -65,14 +65,16 @@ var Modal = React.createClass({ }, renderPortal: function(props) { - if (props.isOpen) { - elementClass(document.body).add('ReactModal__Body--open'); - } else { - elementClass(document.body).remove('ReactModal__Body--open'); - } + if (this.props.isOpen !== props.isOpen) { + if (props.isOpen) { + elementClass(document.body).add('ReactModal__Body--open'); + } else { + elementClass(document.body).remove('ReactModal__Body--open'); + } - if (props.ariaHideApp) { - ariaAppHider.toggle(props.isOpen, props.appElement); + if (props.ariaHideApp) { + ariaAppHider.toggle(props.isOpen, props.appElement); + } } this.portal = renderSubtreeIntoContainer(this, ModalPortal(Assign({}, props, {defaultStyles: Modal.defaultStyles})), this.node);