Keyboard focus should only be shown if the user presses the tab key

Bug #1280004 reported by Jono Mingard on 2014-02-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Wishlist
Unassigned

Bug Description

Showing keyboard focus is great for people who use the keyboard, but it can be distracting and unnecessary for people who use the mouse. It would be nice if keyboard focus was not shown by default, but appeared when the user first pressed the tab key (and possibly other keys such as Space and Enter as well).
However, the accessibility implications of this need to be evaluated - it may be discouraged or banned in WCAG.

Jono Mingard (mingard) wrote :

One way to do this would be something like (in jQuery):

$(function() {
  var focusfunction = function(e) {
    if (e.keyCode == 9) {
      $('body').addClass('showfocus');
      document.removeEventListener('keydown', focusfunction);
    }
  }
  document.addEventListener('keydown', focusfunction, true);
}

And only have focus styles applied under .showfocus (alternatively this could be reversed so the body has a class of hidefocus by default)

Jono Mingard (mingard) wrote :

An easy way to do this for most cases is to remove outline on :active and :hover, eg.
*:active, *:hover { outline: 0 }
However, this won't work for cases where focus management is used, so either JS would have to be added for that or everything which uses focus management would need to have a pretty focus style defined.

Robert Lyon (robertl-9) wrote :

Patch 3017 was abandoned

Robert Lyon (robertl-9) wrote :

The concept of this wishlist bug is to cripple existing accessibility for the normal user (when using mouse) to make it easier for them when using keyboard. This bug has been abandoned as breaking something to fix somthing else is never a good idea.

Changed in mahara:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints