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

fix(backdrop): remove tabindex for improved accessibility #29956

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

Conversation

thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Oct 21, 2024

Issue number: resolves #29773


What is the current behavior?

Certain Chrome and Edge versions (confirmed: Chrome v127 and Edge v127) would indicate that the backdrop has an accessibility violation:

Blocked aria-hidden on a <ion-backdrop> element because the element that just received
focus must not be hidden from assistive technology users. Avoid using aria-hidden on a
focused element or its ancestor. Consider using the inert attribute instead, which will also
prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at

The error is happening because tabindex and aria-hidden are being passed to ion-backdrop. The tabindex attribute is used to make an element focusable, regardless of value. When aria-hidden is applied to an element, then the element is hidden from screen readers. This violates the accessibility standards since ion-backdrop would be considered a focusable element but not visible to screen readers.

What is the new behavior?

  • Removed tabindex, this aligns with frameworks known for accessibility (Chakra UI)

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.3.4-dev.11729533091.1ac77a0c

How to test:

  1. Use either Chrome v127 or Edge v127
  2. Navigate to the alert basic page from the main branch
  3. Open browser console
  4. Click on the first button on the alert page
  5. Click on the backdrop
  6. Notice the error message in the browser console (if you don't see it, then use a private browser or clear cache)
  7. Navigate to the alert basic page from the ROU-11175 branch
  8. Repeat steps 2-6
  9. Verify that the error does not appear

Copy link

vercel bot commented Oct 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ionic-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 21, 2024 5:30pm

@github-actions github-actions bot added the package: core @ionic/core package label Oct 21, 2024
@thetaPC thetaPC marked this pull request as ready for review October 21, 2024 18:45
@thetaPC thetaPC requested a review from a team as a code owner October 21, 2024 18:45
Copy link
Contributor

@gnbm gnbm left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Accessibility issue: Backdrop in ion-popover component has invalid aria-hidden value
3 participants