From: samuelmc Date: Sun, 18 Sep 2016 09:50:07 +0000 (+0200) Subject: Reload focusableElments at every tab keydown to fix issue #9130 X-Git-Tag: v6.2.4-rc1~37^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9187%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Reload focusableElments at every tab keydown to fix issue #9130 --- diff --git a/js/foundation.reveal.js b/js/foundation.reveal.js index 02f99c77a..fbb2c18c8 100644 --- a/js/foundation.reveal.js +++ b/js/foundation.reveal.js @@ -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; @@ -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;