Skip to content

[Feature Request]: Toggle [aria-busy] on container being replaced instead of document element #71

Closed as not planned

Description

@mcaskill

Describe the problem 🧐

From swup/forms-plugin#81:

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.

How important is this feature to you? 🧭

Nice to have

Checked all these? 📚

Activity

  1. hirasso commented on Mar 31, 2025

    @hirasso
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions