Skip to content

Commit

Permalink
make scroll logic more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny committed Oct 29, 2024
1 parent 35376e6 commit 75cea2d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/navigation-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,11 @@ const MainNavigationBarDesktopMenu = ({
// Disable scroll in menu content until height's animation is finished to avoid
// showing the scrollbar while the menu's container is changing it's height
setIsMenuContentScrollable(false);
const id = setTimeout(() => setIsMenuContentScrollable(true), menuAnimationDuration);
return () => clearTimeout(id);
}, [openedSection, menuAnimationDuration]);
if (isMenuOpen) {
const id = setTimeout(() => setIsMenuContentScrollable(true), menuAnimationDuration);
return () => clearTimeout(id);
}
}, [isMenuOpen, openedSection, menuAnimationDuration]);

const columns = sections[openedSection]?.menu?.columns || [];
const customContent = sections[openedSection]?.menu?.content;
Expand Down

0 comments on commit 75cea2d

Please sign in to comment.