Skip to content

Commit ffce566

Browse files
committed
update
1 parent bd0c911 commit ffce566

File tree

1 file changed

+4
-3
lines changed
  • src/components/Header/Nav/ProductNavigation/Desktop

1 file changed

+4
-3
lines changed

src/components/Header/Nav/ProductNavigation/Desktop/MegaMenu.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useEffect } from "react"
66

77
interface MegaMenuProps {
88
cancel: () => void
9+
id?: string
910
}
1011

1112
export const megaMenuSections = [
@@ -130,7 +131,7 @@ export const megaMenuSections = [
130131
},
131132
]
132133

133-
function MegaMenu({ cancel }: MegaMenuProps) {
134+
function MegaMenu({ cancel, id }: MegaMenuProps) {
134135
useEffect(() => {
135136
const onESC = (ev: KeyboardEvent) => {
136137
if (ev.key === "Escape") {
@@ -139,12 +140,12 @@ function MegaMenu({ cancel }: MegaMenuProps) {
139140
}
140141
window.addEventListener("keyup", onESC, false)
141142
return () => {
142-
window.addEventListener("keyup", onESC, false)
143+
window.removeEventListener("keyup", onESC, false)
143144
}
144145
}, [])
145146

146147
return (
147-
<div className={styles.megaMenuContainer}>
148+
<div className={styles.megaMenuContainer} id={id}>
148149
<div className={styles.wrapper} onMouseLeave={cancel}>
149150
<div className={styles.resourcesMenuContentMain}>
150151
{megaMenuSections.map((section) => (

0 commit comments

Comments
 (0)