Search code examples
htmlsafarikeyboardaccessibilitytabindex

Add tabindex / focus to buttons in Safari without changing default browser preferences


When navigating a form using the keyboard, button elements don't gain focus in Safari (tested in v8.0 on Yosemite). This is unless tabbing is explicitly turned under Preferences --> Advanced. Is there any way to get around this?

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <form action="">
    <fieldset>
      <input type="text" />
      <button>Button</button>
      <input type="text" />
      <button type="button">Button</button>
    </fieldset>
  </form>
</head>
<body>
  
</body>
</html>

http://codepen.io/alexandtheweb/pen/raQrxw


Solution

  • There is no way to get around this. The user needs to enable these preferences in order for tabbing to work correctly.