mdn/content

Live Regions accessibility considerations

Open

#11,863 创建于 2022年1月9日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Markdown (22,427 fork)batch import
Content:Accessibilityaccepting PReffort: mediumhelp wanted

仓库指标

Star
 (8,900 star)
PR 合并指标
 (平均合并 7天 3小时) (30 天内合并 147 个 PR)

描述

URL: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions

This is a suggestion to potentially add an "Accessibility considerations" section to make authors aware of the following caveats when using Live Regions:

  1. HTML semantics are (usually) not conveyed in Live Regions (authors should be mindful of this)

    Screen readers announce live regions by taking their child content and announcing it as a single text string. This means that if there are any links, buttons, or other elements with semantics that are typically exposed by screen readers, that information will not be conveyed in the live announcement. That’s not to say that, if navigated to, the elements won’t expose themselves as expected.

    https://www.scottohara.me/blog/2019/07/10/the-output-element.html

  2. The Live Region element (<output>, role="status|alert" etc, aria-live) should be included in the initial markup

    Assistive technology will initially scan the document for instances of the aria-live attribute and keep track of elements that include it. This means that, if we want to notify users of a change within an element, we need to include the attribute in the original markup. In other words, we should not use Javascript to add the aria-live attribute to elements dynamically.

    https://bitsofco.de/using-aria-live/#considerationswhenusingarialive

贡献者指南