From 388c4ed11eeb56c525fb0c7047f551c6ceadcefc Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Sat, 16 Mar 2024 01:34:56 +0100 Subject: [PATCH] fix(mobile): add workaround on chrome --- layouts/partials/header.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 3bd0049..7b374ab 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -46,16 +46,16 @@ 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.style.overflow = "initial"; - document.body.style.overflow = "initial"; - */ + setTimeout(() => { + document.documentElement.style.overflow = "hidden"; + document.body.style.overflow = "hidden"; + }, 800) + setTimeout(() => { + document.documentElement.style.overflow = "initial"; + document.body.style.overflow = "initial"; + }, 810) } })