From: J Potts Date: Wed, 1 Oct 2014 13:46:32 +0000 (+0100) Subject: Refining tabindex setting on tab change X-Git-Tag: v5.4.6^2~1^2~1^2 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F5864%2Fhead;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Refining tabindex setting on tab change All first-children of tab-content was having a tabindex assigned on the change of tab. This caused the unnecessary inclusion of non-form items in the tab ordering and wasn't required to make the tab content accessible. This change is to leave all tabindex attrs of the tab-content items alone, but leave the setting of the tabs themselves unaffected. --- diff --git a/js/foundation/foundation.tab.js b/js/foundation/foundation.tab.js index d45209606..b473343f7 100644 --- a/js/foundation/foundation.tab.js +++ b/js/foundation/foundation.tab.js @@ -142,9 +142,9 @@ 'aria-selected' : null }); $target.attr({ + 'tabindex' : '0', 'aria-selected' : true - }).removeAttr('tabindex') - .focus(); + }).focus(); } // Hide panels @@ -190,12 +190,12 @@ // window (notably in Chrome). // Clean up multiple attr instances to done once tab.addClass(settings.active_class).triggerHandler('opened'); - tab_link.attr({"aria-selected": "true"}).removeAttr('tabindex'); + tab_link.attr({"aria-selected": "true", tabindex: 0}); siblings.removeClass(settings.active_class) siblings.find('a').attr({"aria-selected": "false", tabindex: -1}); - target.siblings().removeClass(settings.active_class).attr({"aria-hidden": "true", tabindex: -1}).end().addClass(settings.active_class).attr('aria-hidden', 'false').find(':first-child').removeAttr('tabindex'); + target.siblings().removeClass(settings.active_class).attr({"aria-hidden": "true", tabindex: -1}); + target.addClass(settings.active_class).attr('aria-hidden', 'false').removeAttr("tabindex"); settings.callback(tab); - target.children().removeAttr('tabindex'); target.triggerHandler('toggled', [tab]); tabs.triggerHandler('toggled', [target]); diff --git a/scss/foundation/components/_tabs.scss b/scss/foundation/components/_tabs.scss index 99124d281..8676e0c47 100644 --- a/scss/foundation/components/_tabs.scss +++ b/scss/foundation/components/_tabs.scss @@ -121,7 +121,3 @@ $tabs-vertical-navigation-margin-bottom: 1.25rem !default; } } } - -[tabindex="-1"] { - outline: none; -}