You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature Request]: Toggle [aria-busy] on container being replaced instead of document element #71
Speaking of accessibility, I've only briefly tested the @swup/a11y-plugin in a different project without @swup/forms-plugin. I noticed the Accessibility plugin toggles [aria-busy] on the document element. Could be practical if it toggled that attribute on the <form> element instead when paired with the Forms plugin.
— @mcaskill, 2025-03-07, 21:40 EST
Right now, [aria-busy] is always applied to documentElement, regardless of whether the visit is a standard swup navigation or triggered by @swup/fragment-plugin / @swup/forms-plugin. Having the attribute on the <form> element specifically when using the forms plugin (or, more generally, on the containers that swup is currently replacing) could indeed be more practical.
— @hirasso. 2025-03-09, 8:10 AM EDT
Describe the propsed solution 😎
As per the title, allow one to automatically toggle [aria-busy] on a container instead of the documentElement when the navigation occurs on a non-page-level element such as a form.
Alternatives considered 🤔
The alternative involves using existing hooks to manually toggle [aria-busy] on the affected container.
We consulted our very own a11y expert about this. They said that toggling aria-busy directly on the replaced containers vs the root element doesn't really help, as, even during fragment visits or inline form visits, the whole document is busy:
Animations might be happening elsewhere on the page, not only on the replaced containers
if @swup/head-plugin and/or @swup/body-class-plugin are active, things might be changing inside the <head> and/or the body class, as well.
Remember: swup always performs full document responses just like normal HTTP visits, also if it only replaces small fragments on the current page.
I'll close this for now, but I'm happy to reopen if we find a definitive advantage of moving aria-busy to the containers in the future.
Activity
hirasso commentedon Mar 31, 2025
We consulted our very own a11y expert about this. They said that toggling aria-busy directly on the replaced containers vs the root element doesn't really help, as, even during fragment visits or inline form visits, the whole document is busy:
@swup/head-pluginand/or@swup/body-class-pluginare active, things might be changing inside the<head>and/or the body class, as well.Remember: swup always performs full document responses just like normal HTTP visits, also if it only replaces small fragments on the current page.
I'll close this for now, but I'm happy to reopen if we find a definitive advantage of moving
aria-busyto the containers in the future.