diff --git a/themes/pybcn_theme/layouts/partials/nav.html b/themes/pybcn_theme/layouts/partials/nav.html index a233ed94..b06a635a 100644 --- a/themes/pybcn_theme/layouts/partials/nav.html +++ b/themes/pybcn_theme/layouts/partials/nav.html @@ -18,13 +18,32 @@ {{ $currentPage := . }} {{ range .Site.Menus.main }} {{ if .HasChildren }} - {{ $dropdown_id := printf "navbar_dropdown_%s" (.Name | urlize) }} + {{/* A section of the menu that opens a list of links, which + is the disclosure pattern of the ARIA practices: a + control that says whether it is open, and the content + it shows. role="button" and aria-expanded carry that. + + Not an ARIA menu. aria-haspopup="true" means a menu, + and the div under it used to name itself after the + control with aria-labelledby, which the HTML validator + rejects on a div with no role: three errors on each of + the 247 pages. The way to make them valid is + role="menu" on the div and role="menuitem" on each + link, and that is a promise this does not keep. An + ARIA menu owes the keyboard arrow keys between the + items, a roving tabindex, and Escape to close, and + Bootstrap 4 gives none of the three here. A reader who + is told it is a menu and finds a list of links is + worse off than one who was told nothing. Two + attributes go instead of one arriving. + + The id went with the label: nothing else read it. */}}