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

Bug #1280004 reported by Jono M
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Invalid
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.

Revision history for this message
Jono M (jonom) 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)

Revision history for this message
Jono M (jonom) 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.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/3017

Revision history for this message
Robert Lyon (robertl-9) wrote :

Patch 3017 was abandoned

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.