From a57345ce78c0c956dd4d8d48c79c681849a97f4f Mon Sep 17 00:00:00 2001 From: Marius Olbertz Date: Thu, 12 Jan 2017 17:37:19 +0100 Subject: [PATCH] Fixed ESC button on drilldown menus. Previously, _back was being called without a parameter which is both a wrong ca$ ESC is now using _hide and will place focus on the anchor that was used to open$ TBD: If hideAll should be called so all sub menus are closed using ESC. --- js/foundation.drilldown.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index 3b7802d69..16c19ceac 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -234,8 +234,11 @@ class Drilldown { return true; }, close: function() { - _this._back(); - //_this.$menuItems.first().focus(); // focus to first element + // Don't close on element in root ul + if (!$element.is(_this.$element.find('> li > a'))) { + _this._hide($element.parent().parent()); + $element.parent().parent().siblings('a').focus(); + } }, open: function() { if (!$element.is(_this.$menuItems)) { // not menu item means back button -- 2.47.2