Tabs > Use unique href for each tab
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
href
s if not given by the author? - By default
gl_tabs_nav
is just anav
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 newgl_tabs
Rails helper that's more specifically designed to work withGlTabsBehavior
🤔
Edited by Mark Florian