这是indexloc提供的服务,不要输入任何密码
Skip to content

Request for aria-description to set accessible description #891

@backwardok

Description

@backwardok

For the accessible name/label of an element, there is aria-label to set the label directly and aria-labelledby to set it via reference to another node. However, for the description of an element, there is only aria-describedby. This requires providing extra descriptive content in a node elsewhere in the DOM to be referenced by id, even if its only purpose is for the description of another node.

In developing, I've found that there are occasionally extra pieces of information that are visually understood but don't have a complete textual representation that need to be provided to AT users in order for it to make more sense. In order to provide that context, visually hidden nodes get added to the markup to expose them with aria-describedby. However, unless the nodes purely for description are also hidden from AT via aria-hidden or applying hidden CSS like display: none, an AT user will end up coming across that descriptive text separately, and potentially out of context.

An example I've seen of this is on Twitter, where each tweet has a button for reply, retweet, and like. The button also includes the number of replies/retweets/likes there are. In this context, it's important that the button label matches the actual action the button has (reply/retweet/like), but it's also important to expose the information that indicates how many existing interactions there were (replies/retweets/likes). Twitter currently uses aria-describedby with a set of nodes that are all at the beginning of the action section and it confusingly gets read out as text prior to reaching the related buttons.

Some of the benefits I see to having an aria-description attribute:

  • Simplification/reduction of the DOM tree (and accessibility tree to some extent)
  • Removal of need to create ids on several nodes
  • Easier association of the actual description to the node itself
  • Relates to an existing ARIA attribute and would therefore be less difficult to support, as a description is already supported for accessibility nodes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions