Skip to content

Dropdowns are inaccessible for screen readers #243

Description

@James1x0

Based on the custom nature of dropdowns, dropdown selects are pretty useless when it comes to screen readers.

screenreaderariasuidrop

SR needs tags like aria-activedescendant and role="listbox", which are rollable with markup...

{{#ui-dropdown
  onChange=(action (mut value))
  as |execute mapper|}}
  <div class="default text">
    --Select--
  </div>
  <i class="dropdown icon"></i>
  <ul id="anId" class="menu" role="listbox" aria-activedescendant="anId__{{value}}">
    {{#each itemArray as |item|}}
      <li id="anId__{{item}}"
        class="item"
        role="option"
        data-value="{{map-value mapper item}}">
        {{item}}
      </li>
    {{/each}}
  </ul>
{{/ui-dropdown}}

But, the listbox is triggered by js, which for aria has to be a popup. To do this, we would need to bind a aria-haspopup attr to the triggering button to reference the listbox menu, and in tandem set aria-expanded to true. Without introducing an ember-specific anti-pattern, this seems impossible to implement.

I'm definitely open to hearing ideas here if someone has figured this out.

Activity

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