Skip to content

Commit

Permalink
fix toggle logic
Browse files Browse the repository at this point in the history
  • Loading branch information
surjithctly committed Jun 20, 2023
1 parent eb23ecd commit c6f2070
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "astro-navbar",
"version": "1.2.1",
"version": "1.2.2",
"description": "Responsive Mobile Navigation with Dropdown in Astro",
"type": "module",
"exports": "./index.ts",
Expand Down
5 changes: 4 additions & 1 deletion src/Astronav.astro
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
} else {
menu.setAttribute("open", "");
}
button?.nextElementSibling?.classList.toggle("hidden");
// Toggle Dropdown Content
const dropdownToggle = button?.querySelector(".dropdown-toggle");
dropdownToggle?.classList.toggle("hidden");

// Close one dropdown when selecting another
Array.from(dropdownMenus)
.filter((el) => el !== menu)
Expand Down

0 comments on commit c6f2070

Please sign in to comment.