Skip to content

Expandable UI sections accessibility #469

@afercia

Description

@afercia

This is about any UI section that expands to show something, for example, the Post Settings:

admin ui default

For accessibility, ideally the expandable sections should be placed in the markup immediately after the control that expands them, or they should be implemented in a way that the sections become the only "reachable" content after the control that expands them.

There are different techniques to implement this, depending on the placement of the expandable section in the markup. Worth exploring a bit the best option. For now, I'd suggest just a couple things:

  • programmatically moving focus from the button to the panel is a no go, as the information provided by the aria-expanded attribute on the button would be missed (yes, the buttons should use aria-expanded)
  • using aria-controls to reference a panel which is far from the button in the markup wouldn't solve the issue, because aria-controls is poop (sorry, it's a quote!)
  • once the panel is open, consider to treat it as sort of "modal" as Adrian Roselli suggested for the content blocks (ping @aardrian !); this way, the panel would be the only available content for keyboard and screen reader users, until they complete the task within the panel. This can be implemented with different techniques, to evaluate with care (constraining tabbing, hiding anything else with aria-hidden, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Priority] HighUsed to indicate top priority items that need quick attention

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions