Skip to content

Commit 588fc92

Browse files
Fix mobile overlay not closing on navigation link clicks (#1198)
* Initial plan * Add onClick handlers to close mobile overlay for all navigation links Co-authored-by: jderochervlk <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jderochervlk <[email protected]>
1 parent a15986e commit 588fc92

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/NavbarMobileOverlay.res

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ module MobileNav = {
2222
prefetch={#intent}
2323
to=#"/blog"
2424
className={linkOrActiveLinkSubroute(~target=#"/blog", ~route)}
25+
onClick=toggleMobileOverlay
2526
>
2627
{React.string("Blog")}
2728
</Link>
@@ -31,6 +32,7 @@ module MobileNav = {
3132
prefetch={#intent}
3233
to=#"/community/overview"
3334
className={linkOrActiveLink(~target=#"/community/overview", ~route)}
35+
onClick=toggleMobileOverlay
3436
>
3537
{React.string("Community")}
3638
</Link>
@@ -40,6 +42,7 @@ module MobileNav = {
4042
prefetch={#intent}
4143
to=#"/packages"
4244
className={linkOrActiveLink(~target=#"/packages", ~route)}
45+
onClick=toggleMobileOverlay
4346
>
4447
{React.string("Packages")}
4548
</Link>
@@ -50,22 +53,23 @@ module MobileNav = {
5053
rel="noopener noreferrer"
5154
className=extLink
5255
ariaLabel="X (formerly Twitter)"
56+
onClick=closeMobileOverlay
5357
>
5458
{React.string("X")}
5559
</a>
5660
</li>
5761
<li className=base>
58-
<a href=Constants.blueSkyHref rel="noopener noreferrer" className=extLink>
62+
<a href=Constants.blueSkyHref rel="noopener noreferrer" className=extLink onClick=closeMobileOverlay>
5963
{React.string("Bluesky")}
6064
</a>
6165
</li>
6266
<li className=base>
63-
<a href=Constants.githubHref rel="noopener noreferrer" className=extLink>
67+
<a href=Constants.githubHref rel="noopener noreferrer" className=extLink onClick=closeMobileOverlay>
6468
{React.string("GitHub")}
6569
</a>
6670
</li>
6771
<li className=base>
68-
<a href=Constants.discourseHref rel="noopener noreferrer" className=extLink>
72+
<a href=Constants.discourseHref rel="noopener noreferrer" className=extLink onClick=closeMobileOverlay>
6973
{React.string("Forum")}
7074
</a>
7175
</li>

0 commit comments

Comments
 (0)