Skip to content

Commit

Permalink
fix: tup 595 accessibility (#761)
Browse files Browse the repository at this point in the history
* adding role=button to a-tags (#757)

* sub-task/tup-579 Added navbarDropdown id to a tag (#758)

* fix: tup 662 nav dropdown id not unique (#762)

* fix: tup-662 nav dropdown id

* fix: tup-662 nav dropdown id, simpler solution

* fix: tup-662 nav dropdown id, follow MDN a11y menu role docs

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menu_role

---------

Co-authored-by: Tomas Gonzalez <[email protected]>
  • Loading branch information
wesleyboar and R-Tomas-Gonzalez authored Dec 13, 2023
1 parent 508fc5f commit 5cbc532
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions taccsite_cms/templates/cms_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
class="nav-link dropdown-toggle"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
aria-expanded="false"
aria-controls="nav-menu-{{child.id}}"
role="button"
id="nav-link-{{child.id}}"
>
{{ child.get_menu_title|safe }}
{% if child.selected %}<span class="sr-only">(current)</span>{% endif %}
<span class="sr-only">Toggle Dropdown</span>
</a>
<div class="dropdown-menu" role="menu" aria-labelledby="navbarDropdown">
<div class="dropdown-menu" role="menu" id="nav-menu-{{child.id}}" aria-labelledby="nav-link-{{child.id}}">
{# Bootstrap4 does not support submenus, so nor do we (and other users). See https://github.com/twbs/bootstrap/pull/6342. #}
{% for grandchild in child.children %}
{% limit_visibility_in_menu grandchild as can_view %}
Expand Down

0 comments on commit 5cbc532

Please sign in to comment.