Affects Version/s: 2.7.2, 2.8.0
Fix Version/s: None
Component/s: Tests & Quizzes (Samigo)
Environment:Non-mouse users (keyboard only and other adaptive technology users), screen-reader users
Previous Issue Keys:SAM-1228
The onclick event handler is triggered when the mouse is pressed when over an HTML element. At first glance, it appears that onclick is a device dependent event handler and that its use alone would be an accessibility problem. However, that is not always the case and here lies the problem.
onclick is intended to be a mouse dependent event handler. However, if the onclick event handler is used with hypertext links or form controls, then most major browsers and assistive technologies trigger onclick if the Enter key or Space bar are pressed when the link or control has focus. In these cases, onclick is a device independent event handler. If an onkeypress hander is also used on these controls, then a problem occurs due to the redundancy created by both event handlers firing when the Enter key or Space bar are pressed.
(Note/FYI: the Enter key will not trigger the onClick event if it is used with non-link and non-control elements, such as div, span, table cells, etc.)
In the Samigo tool, there are many links and form controls that have both an onclick event handler and an onkeypress event handler. This cause many problems for non-mouse users attempting to use the tool. Please watch the following videos for a demo of just a couple of the problems it causes in Tests and Quizzes:
Demonstration of effect on buttons: http://screencast.com/t/KwnYrVCK
Demonstration of effect on links: http://screencast.com/t/QRPKJI1v4
How you reproduce this:
Disconnect the mouse and try to navigate with the keyboard. Assuming that you know how interact with a website using keyboard only navigation, this simple test will very quickly show if it is possible to navigate or interact a feature using an input device other than the mouse. Be especially sure to test interactive features like forms, drop-down menus, expand/contract menus, etc.
1) Simply remove the redundant onkeypress handler from links and form controls.
2) Where onkeypress handlers are required, do not use onkeypress handlers that carry out actions without first testing which key was actually pressed. For instance, make sure only the appropriate keys activate an action (typically the enter and/or space keys). Typically it is inappropriate to let standard navigation keys (like tab, shift+tab, F6, shift+F6, any of the arrow keys (or their modified forms), the escape key, etc.) activate a "control".