Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): nav will not be displayed when scrolling to the top(#1588) #1620

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/theme-default/src/logic/useHiddenNav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ export function useHiddenNav() {
lastScrollTop.current = scrollTop <= 0 ? 0 : scrollTop;
}, 200);

window.addEventListener('mousewheel', onScrollListen);
window.addEventListener('touchmove', onScrollListen);
window.addEventListener('scroll', onScrollListen);

return () => {
window.removeEventListener('mousewheel', onScrollListen);
window.removeEventListener('touchmove', onScrollListen);
window.removeEventListener('scroll', onScrollListen);
};
}, [pathname]);

Expand Down