A11y: high-confidence round2 semantic cleanup#5644
Open
accesswatch wants to merge 2 commits into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
High-confidence round 2 accessibility cleanup that prefers native semantics in shared navigation components: removes invalid/redundant interactive attributes from anchor and button elements, adds explicit labels to mobile header controls, and translates the breadcrumb landmark label.
Changes:
- Remove
type="button"androle="button"from<a>render arrays in the mobile nav block (invalid on anchors). - Remove redundant
role="button"andtabindex="0"from the native<button>inAzSelectMenu. - Add
aria-labelto mobile header controls (search/menu/home/close) and use a translatedaria-labelfor the breadcrumb landmark.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| modules/custom/az_core/src/Plugin/Block/MobileNavBlock.php | Drops type/role button attributes from anchor-rendered nav links. |
| modules/custom/az_select_menu/src/Plugin/Block/AzSelectMenu.php | Removes redundant role=button/tabindex=0 from native button attributes. |
| themes/custom/az_barrio/templates/layout/page.html.twig | Adds aria-labels to mobile offcanvas open/close, search, and home controls. |
| themes/custom/az_barrio/templates/navigation/breadcrumb.html.twig | Switches the breadcrumb landmark to a translated aria-label. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+112
to
+131
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Open search panel'|t }}" class="btn btn-arizona-header" id="jsAzSearch"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">search</span> | ||
| <span class="icon-text">Search</span> | ||
| </button> | ||
| {% endif %} | ||
| {% for offcanvasblock in page.navigation_offcanvas %} | ||
| {% if 'mobile_nav_block' in offcanvasblock['#cache']['keys'] %} | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" class="btn btn-arizona-header"> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Open menu panel'|t }}" class="btn btn-arizona-header"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">menu</span> | ||
| <span class="icon-text">Menu</span> | ||
| </button> | ||
| {% endif %} | ||
| {% endfor %} | ||
| <div class="offcanvas offcanvas-end mw-100 w-100 bg-white d-flex d-lg-none overflow-y-auto" tabindex="-1" id="azMobileNav" aria-label="Mobile navigation"> | ||
| <div class="offcanvas-header sticky-top p-0 mb-2 {{ az_header_blue ? 'text-bg-blue' : 'text-bg-red' }} text-bg-red d-flex justify-content-between align-items-center"> | ||
| <a href="/" class="btn btn-arizona-header"> | ||
| <a href="/" aria-label="{{ 'Go to homepage'|t }}" class="btn btn-arizona-header"> | ||
| <span aria-hidden="true" class="icon material-symbols-rounded">home</span> | ||
| <span class="icon-text">Home</span> | ||
| </a> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" class="btn btn-arizona-header"> | ||
| <button type="button" data-bs-toggle="offcanvas" data-bs-target="#azMobileNav" aria-controls="azMobileNav" aria-label="{{ 'Close menu panel'|t }}" class="btn btn-arizona-header"> |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tugboat has finished building the preview for this pull request! Link: Dashboard: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
modules/custom/az_core/src/Plugin/Block/MobileNavBlock.phptype=buttonfrom link attributes.role=buttonfrom navigational links.modules/custom/az_select_menu/src/Plugin/Block/AzSelectMenu.phprole=buttonandtabindex=0from native<button>attributes.themes/custom/az_barrio/templates/layout/page.html.twigthemes/custom/az_barrio/templates/navigation/breadcrumb.html.twigImpact
accessibility-fixes-high-confidence-round2