Keyboard focus should only be shown if the user presses the tab key
Bug #1280004 reported by
Jono M
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.
To post a comment you must log in.
One way to do this would be something like (in jQuery):
$(function() { ('body' ).addClass( 'showfocus' ); removeEventList ener('keydown' , focusfunction); addEventListene r('keydown' , focusfunction, true);
var focusfunction = function(e) {
if (e.keyCode == 9) {
$
document.
}
}
document.
}
And only have focus styles applied under .showfocus (alternatively this could be reversed so the body has a class of hidefocus by default)