Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Modal tabs into background when last tabbable's tabindex="-1" #5955

Closed
antman888 opened this issue Jun 3, 2016 · 2 comments
Closed

Modal tabs into background when last tabbable's tabindex="-1" #5955

antman888 opened this issue Jun 3, 2016 · 2 comments

Comments

@antman888
Copy link

The issues forum is NOT for support requests. It is for bugs and feature requests only.
Please read https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md and search
existing issues (both open and closed) prior to opening any new issue and ensure you follow the instructions therein.

Bug description: When the last tabbable element in a modal has tabindex="-1", tabbing does not return focus to the first element in the modal. It puts focus onto the background elements.

Link to minimally-working plunker that reproduces the issue: http://plnkr.co/edit/ejYEeIrDul5vrX9twvre?p=preview

Version of Angular, UIBS, and Bootstrap

Angular:

UIBS:

Bootstrap:

@antman888
Copy link
Author

A possible solution is to filter elements with a tabindex="-1" attribute.

var tabbableSelector = 'a[href], area[href], input:not([disabled]):not([tabindex=\'-1\']), ' +
        'button:not([disabled]):not([tabindex=\'-1\']),select:not([disabled]):not([tabindex=\'-1\']), textarea:not([disabled]):not([tabindex=\'-1\']), ' +
        'iframe, object, embed, *[tabindex]:not([tabindex=\'-1\']), *[contenteditable=true]';

@wesleycho
Copy link
Contributor

Sounds legitimate - feel free to file a PR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants