如何允许 Firefox 中链接的键盘焦点? [英] How to allow keyboard focus of links in Firefox?

查看:15
本文介绍了如何允许 Firefox 中链接的键盘焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Webkit 浏览器中转到这个超简单的 fiddle 并单击输入:

Go to this ultra-simple fiddle in a Webkit browser and click on on of the inputs:

http://jsfiddle.net/eK4TT/

<input type="text">
<input type="text">
<input type="text">
<a href="#">my first link</a>
<a href="#">my second link</a>
<a href="#">my third link</a>

然后,请注意您可以使用 Tab 键(和 Shift+Tab 来导航以相反的顺序).

Then, notice that you can keyboard navigate through both the inputs and the links using the Tab key (and Shift+Tab to navigate in reverse order).

现在,在 Mac OS 上的 Firefox 中查看相同的小提琴并执行相同的操作.输入获得焦点,但链接不会获得焦点.这不是 CSS 显示问题.焦点从最后一个输入跳转到 URL 栏.

Now, look at the same fiddle in Firefox on Mac OS and do the same thing. The inputs receive focus, but the links won't receive focus. It's not a CSS display problem. The focus leaps from the last input to the URL bar.

我在标记中尝试了无数的 tabindex 声明组合,但都无济于事,例如:

I've tried endless combinations of tabindex declarations in the markup, and to no avail, e.g.:

http://jsfiddle.net/eK4TT/1/

这到底是怎么回事?我会接受任何答案:

What the heck is going on here? I will accept any answer that has:

a) 在 Firefox 中工作的小提琴
b) 对 Mozilla 头脑中究竟发生了什么的解释.它似乎与规范相矛盾.

a) a fiddle working in Firefox
b) an explanation of what exactly is going on here in Mozilla's head. It appears to contradict the spec.

推荐答案

好的,有人向我解释了这一点.这是 Mac 的问题.Mozilla 忠实于 Mac OS 中的操作系统设置.

Ok, somebody explained this to me. It's a Mac problem. Mozilla is being true to operating system settings in Mac OS.

在用户方面有两种不同的方法可以解决这个问题.两者似乎都有效:

There are two distinct ways around this on the user side. Both seem to work:

  1. 系统偏好设置键盘,在快捷方式窗格中,选中底部的所有控件"单选框.

  1. In System PreferencesKeyboard, in the Shortcuts pane, check the "all controls" radio at the bottom.

在 Firefox 中,在 URL 栏中输入about:config".在 mac 上没有 accessibility.tabfocus 首选项,所以你必须做一个.在窗口中右键单击,新建一个整数"首选项,并将其设置为 7.

In Firefox, type "about:config" in the URL bar. There is no accessibility.tabfocus preference on the mac, so you'll have to make one. Right click in the window, create a new "integer" pref, and set it to 7.

这些都不是很明显.此外,对于开发人员而言,这两种解决方案都不是服务器端解决方案,这令人沮丧.

Neither of these are terribly obvious. Also, neither of these are a server-side solution for developers, which is frustrating.

这篇关于如何允许 Firefox 中链接的键盘焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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