question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buttons for navigation should be anchors [A11y][Good First Issue]

See original GitHub issue

Currently the navigation uses buttons to activate the navigation.

As these affect navigation they should be actual links (anchors) for accessibility.

SUggested

Change from:

<button class="px-4 py-2 font-bold text-black bg-white rounded hov-bg-theme">4C</button>

To:

<a href="https://www.4c.rocks/" class="px-4 py-2 font-bold text-black bg-white rounded hov-bg-theme">4C</a>

Repeat adding relevant hyperlinks for each menu item.

Bonus points

You should wrap the anchors in <li> to ease navigation for screen reader users (as it states how many items there are in the list so they know how large the menu is).

Markup outline:

<nav>
  <ul> <!-- replace the current div here with the <ul>
    <li><a href="ref">text</a></li>
    <li><a href="ref">text</a></li>
    <li><a href="ref">text</a></li>
    <li><a href="ref">text</a></li>
  </ul>
<nav>

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
olybekecommented, Oct 26, 2022

hi @FrancescoXX , I would like to work on this issue. Can you assign me?

0reactions
tobySolutionscommented, Nov 21, 2022

Fixed by #390

Read more comments on GitHub >

github_iconTop Results From Across the Web

Buttons in nav instead of anchor? [duplicate] - Stack Overflow
I've been reading up on web accessibility and read that anchor tags should only be used when the user will be taken to...
Read more >
Anchors, Buttons, and Accessibility - Formidable Labs
(While anchors can act as placeholder links or target link destinations, ... Pressing the enter key should navigate to the URL of the...
Read more >
Anchors vs Buttons - bitsofcode
When navigating with a keyboard, the anchor element can be “clicked” by pressing the enter key. To screen readers, when an anchor tag...
Read more >
Button vs. Anchor - Twilio Paste
From a high level, buttons are to be used for performing an in-page action and anchors/links are for navigating to a new page....
Read more >
v2 add NavAnchor and NavButton · Issue #2216 · grommet ...
To put it another way, I was thinking a control being used for navigation, like in a sidebar, would use Button, not Anchor....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found