Skip to content

[fixed] Handle case when no tabbable element exists #120

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

Merged
merged 1 commit into from
Mar 25, 2016
Merged

[fixed] Handle case when no tabbable element exists #120

merged 1 commit into from
Mar 25, 2016

Conversation

evoyy
Copy link
Contributor

@evoyy evoyy commented Jan 26, 2016

Fixes #44

@claydiffrient
Copy link
Contributor

@evoyy This looks like a great change. Can you add a spec that tests the functionality? I generally like specs to accompany code changes.

@evoyy
Copy link
Contributor Author

evoyy commented Mar 25, 2016

@claydiffrient Spec added.

@@ -92,6 +92,12 @@ describe('Modal', function () {
});
});

it('handles case when child has no tabbable elements', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that you forgot to make an assertion in the spec. It just opens the modal, presses tab then closes it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claydiffrient I have updated the spec to use assert.doesNotThrow().

@claydiffrient
Copy link
Contributor

Okay, I checked out the code and took a look at the actual functionality this makes happen. I'm slightly concerned because this fix allows focus to escape from the modal, which from an accessibility standpoint isn't ideal. Granted I think most use cases of the modal will include a close button of some nature, which avoids this problem. This is nice in that it avoids the errors being thrown when there is nothing to tab to when the user tabs like is currently on master.

I think this is good for now. I want to think about maybe adding a way to switch between modal and non-modal in the future probably though.

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