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

Modal does not trap focus if shift+tab is immediately pressed #5229

Closed
ghost opened this issue Jan 13, 2016 · 2 comments
Closed

Modal does not trap focus if shift+tab is immediately pressed #5229

ghost opened this issue Jan 13, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 13, 2016

By opening a ui.bootstrap.modal which does not have an initially focused element and then pressing shift+tab the keyboard focus will not be trapped within the modal. For instance, if you press the button entitled 'Open me!' on the demo page and press shift+tab a few times the keyboard focus will be behind the dialog.

@wesleycho
Copy link
Contributor

This seems strange, as we have code specifically for this situation, as well as a unit test against this.

@wesleycho
Copy link
Contributor

What is happening here is that the modal does not have focus when it is opened.

The question is, should the modal have focus? On research, the answer appears to be yes. PRs are welcome for moving the focus to the modal window element on instantiation - a simple unit test checking for focus is necessary. This also should not interfere with the autofocus attribute.

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

1 participant