Skip to content

Commit

Permalink
close mobile menu on click outside
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Dec 14, 2020
1 parent 4a393ec commit 23aa79f
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ const Navigation = ({ pathname, type }) => {
</span>
</button>
</div>
<OutsideClickHandler onOutsideClick={() => setOpenDropodownIndex(-1)}>
<OutsideClickHandler
onOutsideClick={() => {
setOpenDropodownIndex(-1);
if (isMobileMenuOpen) {
setMobileMenuOpen(false);
}
}}
>
<Menu
stackable
pointing
Expand Down

0 comments on commit 23aa79f

Please sign in to comment.