Skip to content

Instantly share code, notes, and snippets.

@mzbac
Created August 30, 2016 00:56
Show Gist options
  • Save mzbac/5acf2575550505664f586a8763798fc9 to your computer and use it in GitHub Desktop.
Save mzbac/5acf2575550505664f586a8763798fc9 to your computer and use it in GitHub Desktop.
var ModalFixMixin = {
componentDidMount() {
if (document && document.body) {
var orig = document.body.className;
document.body.className = orig + (orig ? ' ' : '') + 'modal-open';
}
},
componentWillUnmount() {
if (document && document.body) {
document.body.className = document.body.className.replace(/ ?modal-open/, '');
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment