Similar method(s):
https://css-tricks.com/prevent-page-scrolling-when-a-modal-is-open/
// * usage for general showing / hiding elements by modifying body classList
const lockBody = (option) => {
if (option === true) {
document.body.style.top = `-${window.scrollY}px`;
document.body.style.position = 'fixed';
} else {
if (document.body.style.position !== 'fixed') return;
const top = document.body.style.top;
document.body.style.position = '';
document.body.style.top = '';
window.scrollTo(0, parseInt(top || '0', 10) * -1);
}
};
// lockBody(true);