From 4c81ff28c837c7f6775e381eea506680a913b361 Mon Sep 17 00:00:00 2001 From: SassNinja Date: Sat, 5 Aug 2017 16:55:51 +0200 Subject: [PATCH] Swap the autoFocus param so default is no auto focus when using keyboard navi The param must be explicitely set to true to trigger this feature. --- js/foundation.drilldown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/foundation.drilldown.js b/js/foundation.drilldown.js index e8b7a6186..31216939f 100644 --- a/js/foundation.drilldown.js +++ b/js/foundation.drilldown.js @@ -378,7 +378,7 @@ class Drilldown extends Plugin { * @function * @fires Drilldown#open * @param {jQuery} $elem - the target (sub)menu (`ul` tag) - * @param {boolean} autoFocus - if false the first link in the target (sub)menu won't get auto focused + * @param {boolean} autoFocus - if true the first link in the target (sub)menu gets auto focused */ _showMenu($elem, autoFocus) { @@ -392,7 +392,7 @@ class Drilldown extends Plugin { // If target menu is root, focus first link & exit if ($elem.is('[data-drilldown]')) { - if (autoFocus !== false) $elem.find('li[role="treeitem"] > a').first().focus(); + if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus(); if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight')); return; } @@ -414,7 +414,7 @@ class Drilldown extends Plugin { // Last child makes sure the event gets always triggered even if going through several menus if (isLastChild === true) { $(this).one(transitionend($(this)), () => { - if (autoFocus !== false) { + if (autoFocus === true) { $elem.find('li[role="treeitem"] > a').first().focus(); } }); -- 2.47.2