Skip to content

Commit 690f574

Browse files
authored
Make submenus visible during keyboard navigation
I've noticed that the site didn't make submenus visible during keyboard navigation, making everything less intuitive. This change shows the submenu when it has focus on it's `button` element or focus within itself. I'm not sure if the intention behind this would be a "toggle" `button` (with it's corresponding ARIA states) instead of this, as the button currently gains focus but doesn't trigger anything on click.
1 parent 9c37cee commit 690f574

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/components/Navbar.module.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@
141141
}
142142
}
143143

144-
.item:hover .submenu {
144+
.item:hover .submenu,
145+
.item:focus-visible .submenu,
146+
.submenu:focus-within {
145147
opacity: 1;
146148
max-height: 400px;
147149
}

0 commit comments

Comments
 (0)