I am creating my first application where I must have respect for keyboard navigation for reasons of accessibility.
My problem should consist of jquery-ui modal dialogs. If the user clicks a tab on the last control of the dialog (cancel button for this application), the focus goes beyond the dialog box. Or press shift-tab on the first control in the dialog box.
When the user does this, it is not always possible to return to the dialog box. In this regard, IE8 and FF8 behave somewhat differently. I tried to capture the tab key with the following event handler -
lastButton.keydown(function (e) { if (e.which === TAB_KEY_CODE) { e.stopPropagation(); $(this).focus(); } });
But this does not work, as the browser processes the keystroke after jquery is completed.
Two questions -
- To ensure accessibility, do I even need to worry about this? Although, for reasons of usability, I think I should.
- Is there any way to make this work?
source share