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

bug: Ionic 8+ produces Blocked aria-hidden on an element because its descendant retained focus #30240

Open
3 tasks done
kevinclarkadstech opened this issue Mar 12, 2025 · 1 comment
Labels

Comments

@kevinclarkadstech
Copy link

kevinclarkadstech commented Mar 12, 2025

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Navigating back and forth with React Router tabs and pages produces the error: Blocked aria-hidden on an element because its descendant retained focus

If you open the StackBlitz for the IonTabs on the docs, it does not show this error message, because the Ionic version of the docs is 7. But, if you upgrade to the latest version of Ionic (8.4.2 at this time) it will start getting the error message.

https://ionicframework.com/docs/api/tabs

Have not tried it with frameworks other than React

Full error is

/home/profile:1 Blocked aria-hidden on an element because its descendant retained focus. The 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 https://w3c.github.io/aria/#aria-hidden.
Element with focus: a
Ancestor with aria-hidden:

Expected Behavior

The elements should lose focus before the transition of pages so Chrome does not produce the alert.

Steps to Reproduce

Go to https://ionicframework.com/docs/api/tabs and open the Stack Blitz. Look in the console as you navigate from Home to Profile and back. Notice no errors.

Upgrade the package json for ionic-react and ionic-react-router. Re-run the application and notice the console started producing logs.

Code Reproduction URL

https://zt5hvy-amge--5173--495c5120.local-credentialless.webcontainer.io/home/profile

Ionic Info

Ionic:

Ionic CLI : 5.4.16

Utility:

cordova-res : not installed
native-run : not installed

System:

NodeJS : v18.20.3
npm : 10.2.3
OS : Linux 5.0

Additional Information

Thank you so much for creating a great framework! I love working with it and the HMR makes it a great DX. I have been following Ionic since v1.

I first noticed this on my own project and thought it was an issue with how I was implementing it til I noticed this only happens on Ionic 8+.

@ionitron-bot ionitron-bot bot added the triage label Mar 12, 2025
@kevinclarkadstech kevinclarkadstech changed the title bug: bug: Ionic 8+ produces Blocked aria-hidden on an element because its descendant retained focus Mar 12, 2025
@gitMarksa
Copy link

The vue version will also appear

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

No branches or pull requests

2 participants