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

Fixes #69 Incorrect focus trap in modal dialog #103

Merged
merged 1 commit into from
Jul 19, 2016

Conversation

becka11y
Copy link
Contributor

I modified this to keep the focus within the modal dialog as
the user tabs and shift-tabs through the items. This
was done by adding onkeydown handlers to the first and
last focusable /tab-able items in the dialog. When last
item has focus a tab press is captured and focus is set to the first
focusable item. When the first item has focus and a shift-tab is
captured, focus is sent to the last focusable item in the dialog.
Since focus never leaves the dialog, the default handler set in the
enforceFocus function of original modal plugin code is never invoked.
Tested with VoiceOver in Safari,
JAWS 17 and NVDA in Firefox on Windows 10

The convention seems to be to also check in the built files so I included them in the pull request. What about the _site directory? src/js/modal.js was already out of sync when I made my changes so I didn't check in an updated version.

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
Copy link
Contributor

mpnkhan commented Jul 19, 2016

Becky,
Thanks for the fixes. This is working nicely.

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

Successfully merging this pull request may close these issues.

2 participants