Pwa-studio: [bug]: SearchTrigger button does not have an accessible name

Created on 25 Jun 2019  路  4Comments  路  Source: magento/pwa-studio

Describe the bug
The search trigger in the header contains a <button> element which violates accessibility guidelines by not having an accessible name.

To Reproduce
Steps to reproduce the behavior:

  1. Run Lighthouse on https://magento-venia-develop.now.sh
  2. Scroll down to the Accessibility section.
  3. Expand the "Buttons do not have an accessible name" warning.
  4. See error

Expected behavior
All elements required to have an accessible name (that's all form elements) have one.

Screenshots
image

Additional context
This _alone_ is docking us 15 points from the Accessibility score in Lighthouse. And it's an easy fix!

Possible solutions
Add an aria-label field to the <button> element in the SearchTrigger component. It's that easy!


Please let us know what packages this bug is in regards to:

  • [x] venia-concept
  • [ ] pwa-buildpack
  • [ ] peregrine
  • [ ] pwa-devdocs
  • [ ] upward-js
  • [ ] upward-spec
good first issue accessibility bug expedite help wanted venia-concept Patch

All 4 comments

Hi @zetlen . I try to add name on button search but the warning of Lighthouse keep appear. I see a link here have suggest "For

I think the solution requested here is to add aria-label ie: aria-label={'Search Button'}. The actual label text is debatable. I edited the issue description to match what I just said :)

Hey @khoa-le! @sirugh has given you the right advice here; because this button is not displayed like a standard HTML button, where the inner text is visible, it needs an aria-label attribute so screen readers can describe it. If you can make that change to #1395 then we'll merge it right away!

Screenshot from 2019-06-28 08-47-06

It's awesome with 100. Thank you.

Was this page helpful?
0 / 5 - 0 ratings