Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

banner(WCAG2AA): "x" cross button don't have a accessible name #678

Closed
JoaoEnesGoncalves opened this issue Oct 18, 2019 · 3 comments
Closed
Assignees
Labels
🐛 bug Something isn't working
Milestone

Comments

@JoaoEnesGoncalves
Copy link
Contributor

JoaoEnesGoncalves commented Oct 18, 2019

Describe the bug
WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name

To Reproduce
Steps to reproduce the behavior:

  1. run
    pa11y --debug --reporter json --standard WCAG2AA --ignore WCAG2AA.Principle4.Guideline4_1.4_1_1.F77 --ignore WCAG2AA.Principle3.Guideline3_1.3_1_1.H57.2 http://localhost:9002/iframe.html?id=corebanner--banner6

  2. See error

components affected
❌ banner
❌ breadcrumb

AXE

  "code": "button-name",
  "type": "error",
  "typeCode": 1,
  "message": "Buttons must have discernible text (https://dequeuniversity.com/rules/axe/3.3/button-name?application=axeAPI)",
  "context": "<div class=\"ActionContainer-closeAction-262\" role=\"button\" tabindex=\"0\"><svg xmlns=\"http://www.w3.org/2...</div>",
  "selector": "#banner1 > div:nth-child(2) > div > div:nth-child(1)",
  "runner": "axe",
  "runnerExtras": {
    "description": "Ensures buttons have discernible text",
    "impact": "critical",
    "help": "Buttons must have discernible text",
    "helpUrl": "https://dequeuniversity.com/rules/axe/3.3/button-name?application=axeAPI"
  }

WCAG2AA

  "code": "WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name",
  "type": "error",
  "typeCode": 1,
  "message": "This element has role of button but does not have a name available to an accessibility API. Valid names are: element content, aria-label undefined, aria-labelledby undefined.",
  "context": "<div class= ActionContainer - closeAction - 262\\ " role=\\"button\\ " tabindex=\\"  0\\ "><svg xmlns=\\"  http: //www.w3.org/2...</div>",
  "selector": "#root > div:nth-child(2) > div > div > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(1)",
  "runner": "htmlcs",

other selectors/components with same error:

  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(3) > div > div:nth-child(2) > div > div:nth-child(1)",
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(5) > div > div:nth-child(2) > div > div:nth-child(1)",
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(7) > div > div:nth-child(2) > div > div:nth-child(1)",
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(9) > div > div:nth-child(2) > div > div:nth-child(1)",
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(13) > div > div:nth-child(2) > div > div:nth-child(1)"
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(15) > div > div:nth-child(2) > div > div:nth-child(1)"
  "selector":"#root > div:nth-child(2) > div > div > div > div:nth-child(17) > div > div:nth-child(2) > div > div:nth-child(1)"
@JoaoEnesGoncalves JoaoEnesGoncalves changed the title accessibility - banner accessibility - WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name Oct 18, 2019
@JoaoEnesGoncalves JoaoEnesGoncalves changed the title accessibility - WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name accessibility - WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name - This element has role of button but does not have a name available to an accessibility API Oct 21, 2019
@JoaoEnesGoncalves JoaoEnesGoncalves changed the title accessibility - WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name - This element has role of button but does not have a name available to an accessibility API WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name - This element has role of button but does not have a name available to an accessibility API Oct 21, 2019
@JoaoEnesGoncalves JoaoEnesGoncalves added the 🐛 bug Something isn't working label Oct 21, 2019
@nantunes
Copy link
Collaborator

@JoaoEnesGoncalves Please rename this issue so it as a shorter and clearer title.

@JoaoEnesGoncalves JoaoEnesGoncalves changed the title WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name - This element has role of button but does not have a name available to an accessibility API banner(WCAG2AA): "x" cross button don't have a accessible name Dec 4, 2019
@JoaoEnesGoncalves
Copy link
Contributor Author

"x" cross button don't have a accessible name

cross

run:
pa11y --runner htmlcs --runner axe --standard WCAG2AA --root-element "div[class|='Component-content']" http://localhost:9002/iframe.html?id=corebanner--banner8

result:

 • Error: This element has role of "button" but does not have a name available to an accessibility API. Valid names are: element content, aria-label undefined, aria-labelledby undefined.
   ├── WCAG2AA.Principle4.Guideline4_1.4_1_2.H91.Div.Name
   ├── #root > div:nth-child(2) > div > div > div > div:nth-child(4) > div > div:nth-child(2) > div > div
   └── <div class="ActionContainer-closeAction-262" role="button" tabindex="0"><div class="ActionContainer-ico...</div>

@diogofscmariano
Copy link
Contributor

Notes from #697

Banner Component - Issue 678 & Breadcrumb component - Issue 678: This issue refers to the lack of a name available to an accessibility API, which stems from the Button pattern being used in both components. In these scenarios, both are using a built-by-hand component. First, it is recommended that this ad-hoc button implementation be replaced with the ready made button component in our UIKit, and that we add the necessary that would make the button accessible. The current view of the MUI does not seem to have a prop that we can leverage in order to pass in aria-label(for instance), so it may be necessary to specify a new property in our Button Component that would allow for the definition of labels that would handle this accessibility issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants