File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import { useEffect } from "react"
66
77interface MegaMenuProps {
88 cancel : ( ) => void
9+ id ?: string
910}
1011
1112export 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 ) => (
You can’t perform that action at this time.
0 commit comments