From 7be8a6873a38f50496aee90c22116827ca0569bb Mon Sep 17 00:00:00 2001 From: Simon Walenkamp Hansen <141124692+SWH-Relewise@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:44:20 +0100 Subject: [PATCH] Fix: header jumps to the right when categories are hovered (#40) --- src/layout/Header.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/layout/Header.vue b/src/layout/Header.vue index 7c44142..6c94969 100644 --- a/src/layout/Header.vue +++ b/src/layout/Header.vue @@ -23,11 +23,11 @@ let hoverTimeout: ReturnType | null = null; const handleMouseOver = (categoryId: string) => { if (hoverTimeout) clearTimeout(hoverTimeout); hoverTimeout = setTimeout(() => { + const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; document.body.classList.add('overflow-hidden'); if (!document.body.style.marginRight) { - const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; document.body.style.marginRight = `${scrollbarWidth}px`; }