[Bug]: Blocked aria-hidden on an element from ChromeDevTools
Opened this issue ยท 2 comments
What did you expect? ๐ง
When transitioning between pages using SWUP, the transitions should occur smoothly without any accessibility-related console errors.
What actually happened? ๐ตโ๐ซ
EDIT: It only happens when I click on the svg logo that gets me back to the homepage..
During almost every page transition, Chrome DevTools reports the following accessibility error:
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: <div id=โ"swup" class=โ"transition-overlap is-previous-container is-removing-container" x-data=โ"main" style=โ"--swup-parallel-container:โ 1;โ background-color:โ black;โ" aria-hidden=โ"true">โ<div class=โ"swup-content">โ<main>โ</main>โ<footer class=โ"inverted" x-data=โ"footer" data-astro-cid-sz7xmlte>โ<div class=โ"container" data-astro-cid-sz7xmlte>โ<div class=โ"upper-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"outer-lower-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"outer-legals-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"logo-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ</div>โ</footer>โ</div>โ</div>โ
Swup and plugin versions ๐
"swup": "^4.7.0",
"@swup/a11y-plugin": "^5.0.0",
"@swup/debug-plugin": "^4.1.0",
"@swup/head-plugin": "^2.2.1",
"@swup/parallel-plugin": "^0.4.0",
"@swup/preload-plugin": "^3.2.10",
What browsers are you seeing the problem on? ๐งญ
Chrome
Relevant log output ๐ค
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: <div id=โ"swup" class=โ"transition-overlap is-previous-container is-removing-container" x-data=โ"main" style=โ"--swup-parallel-container:โ 1;โ background-color:โ black;โ" aria-hidden=โ"true">โ<div class=โ"swup-content">โ<main>โ</main>โ<footer class=โ"inverted" x-data=โ"footer" data-astro-cid-sz7xmlte>โ<div class=โ"container" data-astro-cid-sz7xmlte>โ<div class=โ"upper-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"outer-lower-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"outer-legals-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ<div class=โ"logo-wrapper" data-astro-cid-sz7xmlte>โโฆโ</div>โ</div>โ</footer>โ</div>โ</div>โ
### URL to minimal reproduction ๐
-
### Checked all these? ๐
- [X] I have read and searched the [official docs](https://swup.js.org)
- [X] I have checked [discussions](https://github.com/orgs/swup/discussions) and [existing issues](https://github.com/issues?q=is:issue+org:swup) for related problems
- [X] I agree to follow this project's [Code of Conduct](https://github.com/swup/.github/blob/master/CODE_OF_CONDUCT.md)
- [X] I have provided all necessary information to the best of my knowledge
Hi! Could you share a url to a minimal reproduction? Much quicker to look into it that way, especially when it seems to be related to which element was clicked exactly and you're using Alpine components as well.
@layout-ch I've transferred this to the correct repo. If you find the time to create a minimal reproduction, let us know โ we'd appreciate it as it makes it easier to look into things.