Skip to content

A11y: improve search button accessible names#5641

Open
accesswatch wants to merge 2 commits into
mainfrom
accessibility-fixes-button-names
Open

A11y: improve search button accessible names#5641
accesswatch wants to merge 2 commits into
mainfrom
accessibility-fixes-button-names

Conversation

@accesswatch
Copy link
Copy Markdown
Contributor

Summary

  • Addresses CSV-reported accessible-name gaps in search button templates.
  • Ensures icon glyphs do not become part of the accessible name.

Issue type targeted

  • aria-input-field-name / button-name style findings for search controls.

Changes

  1. themes/custom/az_barrio/templates/forms/input--search-block-form--submit.html.twig
    • Adds a deterministic button label fallback (Search).
    • Adds aria-label and a visually-hidden text label.
    • Marks search icon as aria-hidden.
  2. themes/custom/az_barrio/templates/forms/input--search-block-button.html.twig
    • Marks search icon as aria-hidden while preserving visible text label.

Impact

  • Impacted files: 2
  • Scope: high-confidence template-only update.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@accesswatch accesswatch requested a review from a team as a code owner May 28, 2026 01:26
Copilot AI review requested due to automatic review settings May 28, 2026 01:26
@accesswatch accesswatch requested a review from a team as a code owner May 28, 2026 01:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves accessible names for search button templates in the az_barrio theme by ensuring the Material Symbols icon glyph is hidden from assistive tech and that buttons have a deterministic accessible label.

Changes:

  • Adds aria-hidden="true" to the icon <span> in both search button templates so the literal text "search" isn't read by screen readers.
  • Adds a deterministic Search fallback label, exposed via aria-label and a visually-hidden span, on the search block form submit template.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
themes/custom/az_barrio/templates/forms/input--search-block-form--submit.html.twig Sets aria-label, adds visually-hidden label text, hides icon from AT.
themes/custom/az_barrio/templates/forms/input--search-block-button.html.twig Hides icon glyph from AT while keeping the existing visible value text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@az-digital-bot
Copy link
Copy Markdown
Contributor

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

Comment thread .github/workflows/ci.yml
Comment on lines +179 to +190
set +e
composer audit --no-dev --ignore-severity=low --ignore-severity=moderate > composer-audit.log 2>&1
composer_audit_status=$?
cat composer-audit.log
if [ "$composer_audit_status" -eq 0 ]; then
exit 0
fi
if [ "$composer_audit_status" -eq 2 ] && grep -q "No security vulnerability advisories found." composer-audit.log; then
echo "Composer audit reported only abandoned packages; continuing."
exit 0
fi
exit "$composer_audit_status"
Copy link
Copy Markdown
Member

@joeparsons joeparsons May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We addressed the composer audit issue in a separate PR: #5657 so these changes are causing merge conflicts now.

Suggested change
set +e
composer audit --no-dev --ignore-severity=low --ignore-severity=moderate > composer-audit.log 2>&1
composer_audit_status=$?
cat composer-audit.log
if [ "$composer_audit_status" -eq 0 ]; then
exit 0
fi
if [ "$composer_audit_status" -eq 2 ] && grep -q "No security vulnerability advisories found." composer-audit.log; then
echo "Composer audit reported only abandoned packages; continuing."
exit 0
fi
exit "$composer_audit_status"
composer audit --no-dev --ignore-severity=low --ignore-severity=moderate --abandoned=report

Copy link
Copy Markdown
Member

@joeparsons joeparsons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall these look great improvements to me. We'll just want to revert the changes to the composer audit job in the CI workflow before merging.

@joeparsons joeparsons added enhancement New feature or request user experience Improvements to user experience labels May 29, 2026
<button{{ attributes }}>
{{ attributes.value }}
<span aria-hidden="true" class="material-symbols-rounded">search</span>
</button>{{ children }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any change here other than syntax?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trackleft It's also adding aria-hidden="true" to the span element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility enhancement New feature or request user experience Improvements to user experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants