Skip to content

Commit

Permalink
Use event instead of
Browse files Browse the repository at this point in the history
  • Loading branch information
divyammadhok committed Feb 23, 2024
1 parent 54b9e91 commit c2d2ffa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/modules/components/AppNavDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function ProductDrawerButton(props) {
setAnchorEl(null);
};

const handleEventDelegation = (e) => {
const handleEventDelegation = (event) => {
// 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;
const isLinkInParentTree = Boolean(event.target.closest('a'));
// If the element clicked is link or just inside of a link element then close the menu.
if (isLinkInParentTree) {
handleClose();
Expand Down

0 comments on commit c2d2ffa

Please sign in to comment.