200

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>

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).

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.

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) 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.

4
  • Not sure what is going on, it may be a weird JSFiddle & FF bug. Try dropping all tabindexs, and put tabindex="-1" on all and only the links. I don't have access to FF to test.
    – Ryan B
    Jul 29, 2012 at 21:13
  • 1
    nah it's a mac thing. see my answer...
    – Ben
    Jul 29, 2012 at 22:29
  • 1
    Oh yeah. This behavior should also happen in Safari too, if you don't have "all controls" enabled or whatever. It isn't a Moz issue
    – Ryan B
    Jul 30, 2012 at 3:26
  • You will find these settings useful: weba11y.com/blog/2014/07/07/keyboard-navigation-in-mac-browsers Jan 22, 2020 at 16:09

5 Answers 5

420
+100

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. In System PreferencesKeyboard, in the Shortcuts pane, check the “all controls” radio at the bottom.

  2. 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.

10
  • 21
    10.9 Mavericks: System Preferences > Keyboard > Shortcuts > 'All controls' radio button at the bottom of the pane. Oct 16, 2014 at 10:22
  • 14
    I'm on Catalina and I had to perform both of these suggestions - updating the system preferences alone didn't seem to change anything in Firefox. Once I added the new preference to Firefox's about:config, Firefox finally allowed tab focusing. Thanks!
    – Ray Brown
    Nov 14, 2019 at 17:08
  • 1
    In MacOS Mojave (Version 10.14.6), I had to perform both suggestions as well. The system preference didn't change Firefox' behavior. Adding the new Firefox preference did the trick. It's pretty wild that hyperlink keyboard focus is not a default behavior in Firefox. Mar 17, 2020 at 23:13
  • 3
    Side note: I had to quit/restart Firefox after changing the config in System Preferences. Also, for Safari, I had to Safari > Preferences > Advanced > Accessibility: [x] Press Tab to highlight each item on a webpage (this was in addition to setting it in System Preferences). Jul 28, 2020 at 23:23
  • 10
    8 years later and (option 2) is still the answer. Fun times.
    – Bruford
    Oct 28, 2020 at 12:29
33

On MacOS Big Sur this is done like this:

Tick the checkbox Use keyboard navigation...

Tick the Use keyboard navigation in the bottom.

I also didn't have to hack the about:config

5
  • 5
    You need a ff restart to have those changes applied Mar 31, 2021 at 0:28
  • 1
    @tobi-or-not-tobi I don't remember having to do that but thank you for sharing! Mar 31, 2021 at 12:19
  • 1
    I did not have to restart Firefox. The settings were applied successfully without doing that.
    – daniels
    Dec 23, 2021 at 9:52
  • 1
    thx! this worked for me without restarting Firefox Jul 15, 2022 at 9:12
  • I can't find this in macOS Ventura (13.3.1). Anyone can give me a hint, please? Apr 11 at 20:57
3

Anyone looking at the second method explained within the accepted answer:

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.

Be aware that there is already a preference named accessibility.tabfocus within the Firefox Developer Edtion which is a boolean.

You can change this to an integer by clicking on the trash icon and deleting the preference. This will then allow you to select the type you would like the preference to be and allow you to assign it a value afterwards.

1

Thanks, I'm on Catalina, and the following works:

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.

0

On macOS Ventura, this keyboard shortcut seems to be able to toggle this behavior:

enter image description here

I did not find a way to toggle this in the settings directly yet, if someone has one please suggest an edit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.