Closed jantimon closed 6 years ago
I have a simple idea to reduce the code size and improve maintainability:
const bodyStyle = document.createElement("style"); document.head.appendChild(style); style.sheet.insertRule('body.react-scrolllock { overflow: hidden !important }');
This way you wouldn't have to track the original styles of the body element and you could just toggle the class and/or remove the stylesheet from document. Also a new maintainer/developer would find out the source of overflow hidden.
body
overflow hidden
This will also resolve #17
Sounds great @jantimon!
Could you submit a PR?
@jantimon @theKashey could you take a look at #28?
I have a simple idea to reduce the code size and improve maintainability:
This way you wouldn't have to track the original styles of the
body
element and you could just toggle the class and/or remove the stylesheet from document.Also a new maintainer/developer would find out the source of
overflow hidden
.