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

Add aria attributes to modal container #728

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spencercanner
Copy link
Contributor

@spencercanner spencercanner commented Sep 15, 2020

  • Add role="dialog" and aria-modal="true" to convey that the container is a modal
  • Add a hidden product title to the modal and reference its id in the aria-labelledby attribute of the container
    • The element is hidden so it is announced when the modal is open, but is not available in the accessibility tree once the modal is open. The same information is contained in the modal, so it would be redundant to have it announced in two different areas.
  • Note: Ideally an id would have been added to the product title in the modal. However, there is a case where the modalProduct component is in an iframe, making it impossible for the parent container to reference that id.

To 🎩 :

  • Create a buy button with a button destination of modal, and modalProduct > iframe: false (default)
  • Navigate a virtual cursor to the button
  • Click the button by pressing the enter key
  • Verify that the product title is announced, followed by web dialog (VoiceOver) or dialog (NVDA)
  • Try to navigate the virtual cursor backwards from the close button, and verify that the new hidden element is not announced
  • Repeat the steps above using a buy button with a button destination of modal, and modalProduct > iframe: true

Browsers:

  • Safari - Mac - VoiceOver
  • Firefox - Windows - NVDA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant