Tabs > Use unique href for each tab

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

In the accessibility audit for tabs it was determined that the href used for each tab link could be unique to the ID of the related tab panel instead of all using href="#". While this has no immediate impact, should JavaScript be unavailable a user would still be able to use the links to get to the related content. It also provides one more way to associate a tab with its tab panel.

This largely applies to usage of the gl_tabs_nav Rails helper.

Questions

  • Should tabs automatically have hrefs if not given by the author?
  • By default gl_tabs_nav is just a nav styled to look like tabs. It can be enhanced with some clientside JS (GlTabsBehavior) to make it behave like actual tabs. Given that, does this make sense still? As in, if JS isn't available, the markup won't become real tabs anyway. Maybe the thing to do here is to add a new gl_tabs Rails helper that's more specifically designed to work with GlTabsBehavior 🤔
Edited by 🤖 GitLab Bot 🤖