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(overlays): do not hide root when toast appears #29962

Merged
merged 3 commits into from
Oct 25, 2024
Merged

Conversation

thetaPC
Copy link
Contributor

@thetaPC thetaPC commented Oct 23, 2024

Issue number: stemmed from #29773


What is the current behavior?

Certain Chrome and Edge versions (confirmed: Chrome v127, v128, v129 and Edge v127) would indicate that certain elements have an accessibility violation:

Blocked aria-hidden on a "ELEMENT NAME" 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

This issue happens when a toast appears and the users clicks on any element that is not related to toast. This is due to the main content having an aria-hidden so users should not to be able to interact with any of those elements. This isn't an issue when an overlay uses a backdrop, like ion-alert because the backdrop prevents a user from interacting with those elements.

What is the new behavior?

  • When toast is present, the main content no longer has an aria-hidden. This aligns with accessibility guidelines. I also verified with other Framework, MD states "Don't trap focus in the snackbar. Users should be able to freely navigate in and out."

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 8.3.4-dev.11729879684.1ea28919

  1. Clone this repo
  2. Install deps
  3. Run the app on a private browser (Chrome v127, v128, v129 or Edge v127)
  4. Open browser console
  5. Click on "Open Toast" button
  6. Click on any element other than "Open Toast" button, like "Open Popover"
  7. Notice the error message
  8. Close private browser
  9. Install dev build: npm install @ionic/angular@8.3.4-dev.11729879684.1ea28919
  10. Repeat steps 4-7
  11. Verify that the error message doesn't occur

Copy link

vercel bot commented Oct 23, 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 25, 2024 6:03pm

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

@brandyscarney brandyscarney left a comment

Choose a reason for hiding this comment

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

Looks good!

@thetaPC thetaPC added this pull request to the merge queue Oct 25, 2024
Merged via the queue into main with commit 322d7c9 Oct 25, 2024
59 checks passed
@thetaPC thetaPC deleted the ROU-11175-fix branch October 25, 2024 19:15
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.

3 participants