Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost tab stop when keyboard cycling thru modal dialog #69

Closed
becka11y opened this issue Jan 22, 2015 · 4 comments
Closed

Lost tab stop when keyboard cycling thru modal dialog #69

becka11y opened this issue Jan 22, 2015 · 4 comments

Comments

@becka11y
Copy link
Contributor

Using the demo page, open the modal dialog example. Note that when you tab and reach the save changes button, pressing tab one more time does not show anything visibly focused. Pressing tab again with cycle to the close X button at the top of the dialog. The extra tab stop is problematic and should be removed. In my use of the modal in Readium, the extra tab stop goes to the URL bar (tested in Safari).

The same problem happens when shift-tabbing through the modal dialog. With focus on the close x, pressing shift-tab causes focus to be lost. Pressing shift-tab again will reach the Save Changes button in the modal dialog.

@patrick-huber
Copy link

+1 on this issue.

This appears to be a bug. Focus is being placed back on the modal container and the anchor/button that triggered the modal. Investigating from my end and will report back with any updates, but for now here's a little script to help diagnose if others want to take a look as well

Running this from console:

$('*').on('focus', function() {
  console.log($(this));
});

And a little screencast showing the odd focus behavior coming back on the modal and mysterious button that triggered the modal somehow: http://youtu.be/RycKVnmaKtE

@mpnkhan
Copy link
Contributor

mpnkhan commented Jan 13, 2016

This was some hack done to support shift+tab behaviour. http://getbootstrap.com/javascript/#modals doesn't support shift+tabbing inside modal container.

@becka11y
Copy link
Contributor Author

Will this ever be fixed correctly? It really isn't usable to a screen reader user and is confusing to a keyboard user because focus gets lost (even if it is temporary).

@mpnkhan
Copy link
Contributor

mpnkhan commented Jul 13, 2016

Please ignore #69 (comment).

Even if i remove modal plugin code, the problem exists. This problem is inherited from http://getbootstrap.com/javascript/#modals .

In order to test:
1.) Navigate to url "http://getbootstrap.com/javascript/#modals"
2.) Activate "Launch Demo Modal" button
3.) Start tabbing
Result:
(a.) Focus is placed on Modal container " <div id="myModal" class="modal fade in" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" style="display: block; padding-left: 0px;">"
(b.) Shift+Tabbing will not work:

Screen shot from firebug:
screen shot 2016-07-13 at 3 40 53 pm

The plugin will just make shift+tab work.

becka11y added a commit to becka11y/bootstrap-accessibility-plugin that referenced this issue Jul 18, 2016
I modified this to keep the focus within the modal dialog as
the user tabs and shift-tabs through the items.
Tested with VoiceOver in Safari,
JAWS 17 and NVDA in Firefox on Windows 10
becka11y added a commit to becka11y/bootstrap-accessibility-plugin that referenced this issue Jul 18, 2016
I modified this to keep the focus within the modal dialog as
the user tabs and shift-tabs through the items.
Tested with VoiceOver in Safari,
JAWS 17 and NVDA in Firefox on Windows 10
mpnkhan added a commit that referenced this issue Jul 19, 2016
Fixes #69 Incorrect focus trap in modal dialog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants