]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Reload focusableElments at every tab keydown to fix issue #9130 9187/head
authorsamuelmc <samuel.moncarey1991@gmail.com>
Sun, 18 Sep 2016 09:50:07 +0000 (11:50 +0200)
committersamuelmc <samuel.moncarey1991@gmail.com>
Sun, 18 Sep 2016 09:50:07 +0000 (11:50 +0200)
js/foundation.reveal.js

index 02f99c77a2ab13889adc098862c32c3a7905cd34..fbb2c18c8a347112ddd4f2ca983a6335f9eb1618 100644 (file)
@@ -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;