Skip to content

Commit

Permalink
Fix: header jumps to the right when categories are hovered (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
SWH-Relewise authored Oct 30, 2024
1 parent c809d0e commit 7be8a68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/layout/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ let hoverTimeout: ReturnType<typeof setTimeout> | 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`;
}
Expand Down

0 comments on commit 7be8a68

Please sign in to comment.