Skip to content

Commit b0327d9

Browse files
committed
fix: prevent menu links from being focusable when menu is closed
1 parent e1d02aa commit b0327d9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/components/Nav/MainNavLinks.tsx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,31 @@ export const MainNavLinks = ({
7575
<ul>
7676
{links.map((link) => (
7777
<li key={link.label}>
78-
<a href={link.url}>{link.label}</a>
78+
<a href={link.url} tabIndex={isOpen ? 0 : -1}>
79+
{link.label}
80+
</a>
7981
</li>
8082
))}
8183
</ul>
8284
<ul class="flex flex-col gap-[15px]">
8385
<li>
84-
<a className={styles.buttonlink} href="https://editor.p5js.org">
86+
<a
87+
className={styles.buttonlink}
88+
href="https://editor.p5js.org"
89+
tabIndex={isOpen ? 0 : -1}
90+
>
8591
<div class="mr-xxs">
8692
<Icon kind="code-brackets" />
8793
</div>
8894
{editorButtonLabel}
8995
</a>
9096
</li>
9197
<li>
92-
<a className={styles.buttonlink} href="/donate/">
98+
<a
99+
className={styles.buttonlink}
100+
href="/donate/"
101+
tabIndex={isOpen ? 0 : -1}
102+
>
93103
<div class="mr-xxs">
94104
<Icon kind="heart" />
95105
</div>

0 commit comments

Comments
 (0)