对于何时覆盖/模式对话框打开,是否有Web可访问性的规则,是否有任何元素应该是焦点? [英] Is there a rule for Web accessibility as to when an overlay / modal dialog is open, whether any element should be the focus?

查看:177
本文介绍了对于何时覆盖/模式对话框打开,是否有Web可访问性的规则,是否有任何元素应该是焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经看到过几种行为:

I have seen several behaviors:


  1. (通常位于叠加层的右上角)。

  2. 叠加层中的一些其他元素是关注的。

如果符合ADA / ARIA标准,任何元素都应该集中在哪里?

If conforming to ADA / ARIA standards, should any element be in focus?

推荐答案

目前推荐的行为是在对话框中关注第一个可调焦的元素。然而,最近有一些有关该实施的辩论,因为它给那些使用屏幕放大软件和屏幕阅读器

The current recommend behavior is to focus the first focusable element in the dialog. However, there has been some debate on that implementation recently as it poses problems for users who use screen magnification software and screen readers.


如果显示焦点移动到对话底部的控件上,会发生一些负面的事情:

in cases where the focus on display moves to a control at the bottom of the dialog a few negative things happen:


  1. 对于屏幕放大镜用户,由于视口仅包含对话内容的一小部分(典型放大400-600%),所以焦点移动到控件上,内容被查看,不像对话框的顶部,底部内容不提供上下文。用户必须四处浏览才能了解正在发生的事情。

  2. 对于SR用户(例如JAWS),只有焦点元素的内容被宣布,用户必须浏览的内容来了解​​正在发生的事情。
  1. For a screen magnifier user the focus moves to the control, due to the viewport containing only a small portion of the dialog content (typical magnifcation 400-600%) only the bottom part of the content is viewed, unlike the top of the dialog, the bottom content offers no context. users have to navigate around to get an idea of what is going on.
  2. For an SR user (such as JAWS) only the content of the focused element is announced, users have to navigate around the content to get an idea of what is going on.


辩论似乎并不被解决,但是对于新建议的共识正在增长:如果对话框中的任何元素具有自动对焦元素,则将该元素作为焦点。

The debate doesn't appear to be settled, but consensus is growing towards a new recommendation:

    li>
  1. 否则,使用 tabindex = -1 outline:none 来关注对话框本身。

  1. If any element in the dialog has the autofocus element, focus that element.
  2. Otherwise focus the dialog itself using tabindex=-1 and outline: none.

对话框元素本身可以让屏幕阅读器读取对话框的内容给用户,给他们上下文,屏幕放大镜将从对话框的左上角开始,以便他们可以开始阅读开始。

Focusing the dialog element itself allows screen readers to read the contents of the dialog to the user, giving them context right away, and a screen magnifier will start at the top left corner of the dialog so they can start reading it from the beginning.

这篇关于对于何时覆盖/模式对话框打开,是否有Web可访问性的规则,是否有任何元素应该是焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆