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

Reload focusableElments at every tab keydown to fix issue #9130 #9187

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/foundation.reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class Reveal {
// handle keyboard event with keyboard util
Foundation.Keyboard.handleKey(e, 'Reveal', {
tab_forward: function() {
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element);
if (_this.$element.find(':focus').is(_this.focusableElements.eq(-1))) { // left modal downwards, setting focus to first element
_this.focusableElements.eq(0).focus();
return true;
Expand All @@ -326,6 +327,7 @@ class Reveal {
}
},
tab_backward: function() {
_this.focusableElements = Foundation.Keyboard.findFocusable(_this.$element);
if (_this.$element.find(':focus').is(_this.focusableElements.eq(0)) || _this.$element.is(':focus')) { // left modal upwards, setting focus to last element
_this.focusableElements.eq(-1).focus();
return true;
Expand Down