]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Refining tabindex setting on tab change 5864/head
authorJ Potts <jopotts@gmail.com>
Wed, 1 Oct 2014 13:46:32 +0000 (14:46 +0100)
committerJ Potts <jopotts@gmail.com>
Wed, 1 Oct 2014 13:46:32 +0000 (14:46 +0100)
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.

js/foundation/foundation.tab.js
scss/foundation/components/_tabs.scss

index d4520960621c2b47d4e5d3b8df80a725ff6940bc..b473343f761dbc4330792eb688158ea81d56fd67 100644 (file)
                 'aria-selected' : null
               });
               $target.attr({
+                'tabindex' : '0',
                 'aria-selected' : true
-              }).removeAttr('tabindex')
-                .focus();
+              }).focus();
             }
 
             // Hide panels
       // 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]);
 
index 99124d281998cac2c90b205a9186ee6031c22b72..8676e0c47af6d6c88f2bc45a80d49184b06e1b84 100644 (file)
@@ -121,7 +121,3 @@ $tabs-vertical-navigation-margin-bottom: 1.25rem !default;
     }
   }
 }
-
-[tabindex="-1"] {
-  outline: none;
-}