Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
Close on escape
Browse files Browse the repository at this point in the history
  • Loading branch information
PietiKinnunen committed Jul 18, 2024
1 parent 73331e4 commit e12c78a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/Menu/Category.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ const MenuCategory = ({
)}
ref={ref}
onMouseLeave={() => toggleOpened(null)}
onKeyDown={(e) => {
if (e.key === "Escape") {
onToggleOpened(null);
}
}}
>
{isDropdown === "link" ? (
<Link
Expand Down

0 comments on commit e12c78a

Please sign in to comment.