Skip to content
Snippets Groups Projects
Commit 956bc1a2 authored by Stephen Mustgrave's avatar Stephen Mustgrave
Browse files

Issue #3381033 by dcam, mfv: The default tab's LI wrapper can receive focus

parent dcfa5f57
No related branches found
No related tags found
3 merge requests!21Issue #3407343 Add theme template for loading animation/markup,!14Issue #3189439: Last clicked tab history should be configurable,!11Issue #3238148: Tabs still displayed even when empty
Pipeline #364722 passed with warnings
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
// Set clicked tab to active. // Set clicked tab to active.
$(this).parents('li').siblings().removeClass('active'); $(this).parents('li').siblings().removeClass('active');
$(this).parents('li').siblings().attr('aria-selected', 'false'); $(this).parents('li').siblings().attr('aria-selected', 'false');
$(this).parents('li').siblings().attr('tabindex', '-1');
$(this).parents('li').siblings().find('a').attr('tabindex', '-1'); $(this).parents('li').siblings().find('a').attr('tabindex', '-1');
$(this).parents('li').addClass('active'); $(this).parents('li').addClass('active');
$(this).parents('li').attr('aria-selected', 'true'); $(this).parents('li').attr('aria-selected', 'true');
... ...
......
...@@ -143,12 +143,10 @@ class QuickTabs extends TabRendererBase { ...@@ -143,12 +143,10 @@ class QuickTabs extends TabRendererBase {
'aria-controls' => $block_id, 'aria-controls' => $block_id,
'aria-selected' => 'false', 'aria-selected' => 'false',
'id' => $tab_id, 'id' => $tab_id,
'tabIndex' => '-1',
]; ];
if ($default_tab == $index) { if ($default_tab == $index) {
$wrapper_attributes['class'] = ['active']; $wrapper_attributes['class'] = ['active'];
$wrapper_attributes['aria-selected'] = 'true'; $wrapper_attributes['aria-selected'] = 'true';
$wrapper_attributes['tabindex'] = '0';
} }
if ($custom_class) { if ($custom_class) {
$wrapper_attributes['class'][] = $custom_class; $wrapper_attributes['class'][] = $custom_class;
...@@ -199,6 +197,7 @@ class QuickTabs extends TabRendererBase { ...@@ -199,6 +197,7 @@ class QuickTabs extends TabRendererBase {
'attributes' => [ 'attributes' => [
'class' => $link_classes, 'class' => $link_classes,
'data-quicktabs-tab-index' => $index, 'data-quicktabs-tab-index' => $index,
'tabindex' => $default_tab == $index ? 0 : -1,
], ],
] ]
) )
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment