Skip to content

Search field: Added aria-label and name to search input for accessibility (closes #21938)#21962

Merged
leekelleher merged 4 commits intoumbraco:mainfrom
andreaslborg:v17/bugfix/21938-search-wcag-accessibility
Mar 3, 2026
Merged

Search field: Added aria-label and name to search input for accessibility (closes #21938)#21962
leekelleher merged 4 commits intoumbraco:mainfrom
andreaslborg:v17/bugfix/21938-search-wcag-accessibility

Conversation

@andreaslborg
Copy link
Copy Markdown
Contributor

Description

This PR addresses #21938, which notes that the search input field lacks a programmatic label, causing accessibility issues and Google Console warnings.

Previously, the search input only had a placeholder attribute but no name or accessible label (aria-label). This caused:

  • Google Console warnings about form fields missing id or name attributes
  • WCAG accessibility compliance failures (WCAG 2.5.3 and 3.3.2)
  • Screen readers unable to properly identify the search input field

To fix this, the search input now includes:

  • name="search-input" attribute to provide form field identification
  • aria-label attribute using the localized placeholder text

These attributes work together to ensure the input is properly labeled and accessible to assistive technologies, while maintaining the existing visual design and behavior.

Testing

Default setup - Open the Umbraco backoffice, click the search icon, and verify the search input is visible and functional with improved accessibility.

Screen reader testing - Using NVDA, JAWS, or similar, the input field should be announced with its label ("Type to search...") and properly identified as a text input.

Developer console - Verify no warnings about missing form field identification and that the name and aria-label attributes are present on the input element.

Search functionality - Type in the search field, verify results appear correctly, navigate using keyboard (Arrow Up/Down, Tab), and verify Enter key closes the modal.

- Add aria-label attribute to search input using localized placeholder text
- Add name attribute ("search-input") to provide form field identification
- Fixes Google Console warning about missing id/name on form field
- Improves WCAG 3.3.2 compliance (Labels or Instructions)
- Improves WCAG 2.5.3 compliance (Form input identifiable names)

Closes umbraco#2193
@github-actions
Copy link
Copy Markdown

github-actions bot commented Feb 27, 2026

Hi there @andreaslborg, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@andreaslborg andreaslborg changed the title Added aria-label and name to search input for accessibility (closes #21938) Search field: Added aria-label and name to search input for accessibility (closes #21938) Feb 27, 2026
@leekelleher leekelleher self-requested a review March 2, 2026 18:00
@emmagarland
Copy link
Copy Markdown
Collaborator

Sorry @leekelleher, I updated the branch then realised its on your review list :)

@leekelleher
Copy link
Copy Markdown
Member

@emmagarland No problem at all. I hadn't got around to reviewing it yet.

Copy link
Copy Markdown
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

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

Super, thanks @andreaslborg!

I made a couple of tweaks whilst reviewing, just minor code tidy-up that I'd been wanting to do for a while, nothing directly related to your fix.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessibility - Backoffice - Search input is missing label

3 participants