]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Prevent keyboard trap in drilldown menu. 9634/head
authorMarius Olbertz <marius.olbertz@gmail.com>
Thu, 12 Jan 2017 07:11:26 +0000 (08:11 +0100)
committerMarius Olbertz <marius.olbertz@gmail.com>
Thu, 12 Jan 2017 07:11:26 +0000 (08:11 +0100)
Added check if current element is first/last element in root ul of drilldown.
Only prevents default if this is not the case now.

Fixes #9597

js/foundation.drilldown.js

index 3b7802d69620556b2389d2768a1627d0b675f873..53673bccadf2edf63bb2d014b06c5cac4f0894e6 100644 (file)
@@ -227,11 +227,13 @@ class Drilldown {
         },
         up: function() {
           $prevElement.focus();
-          return true;
+          // Don't tap focus on first element in root ul
+          return !$element.is(_this.$element.find('> li:first-child > a'));
         },
         down: function() {
           $nextElement.focus();
-          return true;
+          // Don't tap focus on last element in root ul
+          return !$element.is(_this.$element.find('> li:last-child > a'));
         },
         close: function() {
           _this._back();