From 86d9107d59ad2a228390ca515baff8e22da67c30 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Fri, 15 Mar 2024 11:29:39 +0100 Subject: [PATCH] fix(menu): dynamic overflow hidden on documentElement --- layouts/partials/header.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index cae8d77..ee76de0 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -46,9 +46,11 @@ const nav_button = document.getElementById("navi-toggle") nav_button.addEventListener("change", event => { if (event.target.checked) { + document.documentElement.style.overflow = "hidden"; document.body.style.overflow = "hidden"; } if (!event.target.checked) { + document.documentElement.overflow = "initial"; document.body.style.overflow = "initial"; } })