为什么屏幕读取器通过直接选择它们导航无线电 /复选框按钮?

发布于 2025-01-26 18:52:14 字数 385 浏览 2 评论 0原文

我试图对WCAG友好,并创建了一组广播按钮,当他们收到换个方案时,触发动作。但是,当我尝试通过Shift+Arrow浏览它时,我发现它不仅会集中在它们,还要立即检查它们吗?我在这里错过了什么,还是正常的行为?

编辑:

例如,代码看起来像这样:

<input type="radio" name="month" value="jan">January</input>
<input type="radio" name="month" value="feb">February</input>
<input type="radio" name="month" value="mar">March</input>

I'm trying to be WCAG friendly and have created a group of radio buttons, which, when they receive on-change, trigger action. But when I tried to navigate it by shift+arrow, I discovered that it doesn't just focus them, but right away checks them on? Am I missing something here, or is that normal behavior?

Edit:

The code looks like this for example:

<input type="radio" name="month" value="jan">January</input>
<input type="radio" name="month" value="feb">February</input>
<input type="radio" name="month" value="mar">March</input>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只想待在家 2025-02-02 18:52:14

您没有发布任何代码,因此我假设您正在使用

<input type="radio">

,并且其中有几个具有相同的name属性,并且每个广播按钮都具有与它们的正确关联标签。 (很多假设,但我们只能猜测您不发布任何代码。)

当最初选择 no 无线电按钮时,不同的浏览器对它们进行了不同的处理导航。

  • 在Firefox上,我可以选项卡 组中的每个单选按钮。
  • 在Chrome上,我只能选项卡 组中的一个单选按钮。

选项卡 do 选择“单选”按钮。它只会将焦点移动到那里。

一旦我的重点放在广播按钮上,箭头键就会执行两个行为:

  1. 它将焦点移至组中的下一个(或上一个)中的下一个(或上一个)
  2. 单选按钮。广播按钮。

听起来您要问#2 Behaivor。如果是这样,那么您看到的就是正常行为。

You didn't post any code so I'll assume you're using

<input type="radio">

and that you have several of them all with the same name attribute and that each radio button has a properly associated label with them. (Lots of assumptions but we can only guess if you don't post any code.)

When no radio buttons are initially selected, different browsers treat navigation to them differently.

  • On Firefox, I can tab to each radio button in the group.
  • On Chrome, I can only tab to one radio button in the group.

The tab does not select the radio button. It only moves the focus there.

Once my focus is on a radio button, then the arrow keys perform two behaviors:

  1. It moves the focus to the next (or previous) radio button in the group and
  2. It selects the radio button.

It sounds like you're asking about #2 behaivor. If so, then what you are seeing is normal behavior.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文