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

Better handling of keyboard navigation to be "accessible"? #26

Closed
patrickhlauke opened this issue May 6, 2013 · 2 comments
Closed

Better handling of keyboard navigation to be "accessible"? #26

patrickhlauke opened this issue May 6, 2013 · 2 comments
Milestone

Comments

@patrickhlauke
Copy link

As the term "accessible" is being used here, it's worth noting that ideally the modal should handle keyboard navigation a bit better - if it acts as a true modal, users that navigate via keyboard should, after opening the modal, only be able to tab/shift+tab through the links/elements of the modal itself until it's closed. this will require some additional JS to set initial focus into the modal, make sure that focus stays/cycles within the modal itself, and is returned back to the main page after the modal is closed.

@drublic
Copy link
Owner

drublic commented May 6, 2013

Thanks for the comment and thoughts, Patrick.

The modal is focused when opening it. Please see this line and the setFocus function in modal.js. And it works for me. Do you have problems using it?
This implementation doesn't include cycling through the modal though. Do you have any hint on how to enforce cycling through an element?

I tried to focus back on the main page when the modal is closed here. I might have to look into restoring the original focus state on the actual element instead of the body element which happens in Chrome.

An update for the cycling should definitely be implemented.

@drublic
Copy link
Owner

drublic commented May 15, 2013

Ping @patrickhlauke. Would be awesome if you could throw some links at me :) I'd love to include it in the next version.

drublic added a commit that referenced this issue Jun 30, 2013
When tabbing through the modal the focus remains within the modal
and re-starts at the beginning when it reaches the last tabbable
element within the modal.

Closes #26.
drublic added a commit that referenced this issue Jul 1, 2013
@drublic drublic closed this as completed Jul 12, 2013
drublic added a commit that referenced this issue Oct 7, 2013
When tabbing through the modal the focus remains within the modal
and re-starts at the beginning when it reaches the last tabbable
element within the modal.

Closes #26.
drublic added a commit that referenced this issue Oct 7, 2013
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

2 participants