Selected category remains highlighted after returning to the homepage
Hi! Thanks for this component!
I noticed that after selecting a category through either the categories navbar or the sidebar, it remains underlined in the navbar even after clicking the forum logo to return to the homepage.
Steps to reproduce:
- Open a category through the navbar or sidebar.
- Confirm that the category is highlighted in the navbar.
- Click the forum logo to return to the homepage.
- The previously selected category remains highlighted.
Expected behavior: When returning to the homepage, no category should remain highlighted.
Looking at custom-categories-navbar.gjs, the likely cause is in setActiveSlug(): it updates activeSlug when the current route has a category, but doesn’t clear it when the route has no category.
Would adding an else to the existing condition resolve this?
} else {
this.activeSlug = "";
}
This should clear the active category when navigating back to the homepage while preserving the existing highlighting behavior within categories and subcategories.
Kind regards,
Prof. Caju