Skip to content

Commit

Permalink
Remove keydown events
Browse files Browse the repository at this point in the history
  • Loading branch information
divyammadhok committed Feb 19, 2024
1 parent f14b7b3 commit 54b9e91
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions docs/src/modules/components/AppNavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ function ProductDrawerButton(props) {
};

const handleEventDelegation = (e) => {
// In case of key down events, and any key apart from `enter` is clicked then don't close the menu.
if (e?.type === 'keydown' && e.key !== 'Enter') {
return;
}

// Assert whether an 'a' tag resides in the parent of the clicked element through which the event bubbles out.
const isLinkInParentTree = e?.target ? Boolean(e.target.closest('a')) : false;
// If the element clicked is link or just inside of a link element then close the menu.
Expand Down Expand Up @@ -113,7 +108,6 @@ function ProductDrawerButton(props) {
},
}}
onClick={handleEventDelegation}
onKeyDown={handleEventDelegation}
>
<MuiProductSelector />
</Menu>
Expand Down

0 comments on commit 54b9e91

Please sign in to comment.