Skip to content

Commit dec93dc

Browse files
authored
Merge pull request #28 from TrigamDev/main
Add more element types that are considered 'inside the dropdown'
2 parents 4f20cbc + 297ba69 commit dec93dc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "astro-navbar",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "Responsive Mobile Navigation with Dropdown in Astro",
55
"type": "module",
66
"exports": "./index.ts",

src/Astronav.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ function closeAllDropdowns(event) {
103103
);
104104
const isButtonInsideDropdown = [
105105
...document.querySelectorAll(
106-
".astronav-dropdown button, .astronav-dropdown-submenu button, #astronav-menu"
106+
`.astronav-dropdown button, .astronav-dropdown label, .astronav-dropdown input,
107+
.astronav-dropdown-submenu button, .astronav-dropdown-submenu label, .astronav-dropdown-submenu input,
108+
#astronav-menu`
107109
),
108110
].some((button) => button.contains(event.target));
109111
if (!isButtonInsideDropdown) {

0 commit comments

Comments
 (0)