Repository navigation
[Bug]: Blocked aria-hidden on an element from ChromeDevToolsΒ #19
Copy link
Copy link
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
daun commentedon Oct 27, 2024
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.
daun commentedon Nov 1, 2024
@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.