Merge pull request #799 from dynamic-do/fixes-scroll-in-IE11

Fixes scroll after overlay closing in IE11
old
Javi Velasco 2016-09-19 09:47:37 +02:00 committed by GitHub
commit 4df321c553
1 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class Overlay extends Component {
componentWillUpdate (nextProps) {
if (nextProps.active && !this.props.active) document.body.style.overflow = 'hidden';
if (!nextProps.active && this.props.active) document.body.style.overflow = null;
if (!nextProps.active && this.props.active) document.body.style.overflow = '';
}
componentDidUpdate () {
@ -43,7 +43,7 @@ class Overlay extends Component {
}
componentWillUnmount () {
document.body.style.overflow = null;
document.body.style.overflow = '';
if (this.escKeyListener) {
document.body.removeEventListener('keydown', this.handleEscKey);
this.escKeyListener = null;