Skip to content

Instantly share code, notes, and snippets.

@cvrebert
Last active July 5, 2022 16:20
Show Gist options
  • Star 53 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cvrebert/68659d0333a578d75372 to your computer and use it in GitHub Desktop.
Save cvrebert/68659d0333a578d75372 to your computer and use it in GitHub Desktop.
Click and focus behavior across browsers & OSes

Test apparatus: http://jsfiddle.net/hRub4/

(Windows = Windows 8.1 desktop)

  • Windows Chrome 39
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Firefox 30.0
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Windows Internet Explorer 11
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click and via keyboard tabbing
  • Opera 12.12 on Windows 7
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click; can NOT be focused via keyboard tabbing (even with tabindex)
  • Opera 12.16 on Mac OS X
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click; requires tabindex to be focused via keyboard tabbing
  • Opera 12.16 on Linux
    • Button focuses on click and via keyboard tabbing
    • Anchor focuses on click; can NOT be focused via keyboard tabbing (even with tabindex)
  • Mac OS X Chrome 39
    • Button focuses on click
    • Anchor focuses on click and via keyboard tabbing
  • Mac OS X Firefox 30.0
    • Button does NOT focus on click (even with tabindex); can be focused via keyboard tabbing
    • Anchor focuses on click; can NOT be focused via keyboard tabbing (even with tabindex)
      • To get keyboard tabbing to work, the user must change System/Firefox preferences (see http://stackoverflow.com/a/11713537); the webpage author can't do anything about it (barring the use of hacky JavaScript)
  • Mac OS X Safari 7.0.5
    • Button
      • can be focused by Option+Tab-ing
      • can NOT be focused by clicking (even with tabindex)
    • Anchor can be focused by:
      • Option+Tab-ing
      • Clicking, but ONLY when the anchor has a tabindex
  • iOS Safari 7.0.4
    • Button can NOT be focused via tapping (even with tabindex)
    • Anchor can be focused via tapping, but ONLY when the anchor has a tabindex

This data is now mostly documented on MDN:

@hiyangguo
Copy link

OS X 10.13.5,Safari 11.1.1 (13605.2.8): Button can't focused by tabbing or clicking (even with [tabindex])

@mali891
Copy link

mali891 commented May 16, 2019

OS X 10.13.6, Safari 11.1.2 (13605.3.8): Button can't focused by tabbing or clicking (even with [tabindex])

@lemnis
Copy link

lemnis commented Jun 9, 2021

macOs 11.1 with Firefox 89:
Button focuses on click and via keyboard tabbing
Anchor focuses on click; can NOT be focused via keyboard tabbing

(button click is different than last reported)

macOs 11.1 with Safari 14.0.2 👉 same as last reported
macOs 11.1 with Chrome 91 👉

  • Button focuses on click and via keyboard tabbing
  • Anchor focuses on click and via keyboard tabbing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment