added dedicated style for overflow: hidden on body
This commit is contained in:
parent
48650545bd
commit
f110669e31
3 changed files with 15 additions and 10 deletions
|
@ -57,10 +57,11 @@ const NavComponent: Component<NavProps> = props => {
|
|||
if (open()) {
|
||||
window.addEventListener("click", handleClickOutside);
|
||||
document.body.style.overflow = "hidden";
|
||||
document.body.classList.add("overflow-nav");
|
||||
document.body.classList.add("dim-content-nav");
|
||||
} else {
|
||||
window.removeEventListener("click", handleClickOutside);
|
||||
document.body.style.overflow = "auto";
|
||||
document.body.classList.remove("overflow-nav");
|
||||
document.body.classList.remove("dim-content-nav");
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue