From: SassNinja Date: Sat, 5 Aug 2017 14:55:51 +0000 (+0200) Subject: Swap the autoFocus param so default is no auto focus when using keyboard navi X-Git-Tag: v6.4.4-rc1~18^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10509%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git 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. --- 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(); } });