Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelog.d/fixed-475.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fix(navbar): clear the pending hide timer before rescheduling in useNavDropdowns so leaving via the menu and re-entering no longer closes the dropdown (#475).
5 changes: 5 additions & 0 deletions src/components/navbar/useNavDropdowns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export function useNavDropdowns() {
};

const hideMenu = () => {
clearHideTimeout();
timeoutRef.current = setTimeout(() => {
menu.style.display = "none";
menu.style.opacity = "0";
Expand Down Expand Up @@ -179,6 +180,10 @@ export function useNavDropdowns() {
};

const handleMouseLeave = () => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
timeoutRef.current = null;
}
timeoutRef.current = setTimeout(() => {
const langButton = langSwitcher.querySelector("button");
const dropdown = document.querySelector('[role="listbox"]');
Expand Down
Loading