Skip to content

Commit

Permalink
fix(tabs-extended): update aria-selected label and disabled tab (#5917)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

#5814 #5815

### Description

Use `active` state to set `aria-selected` label. Adjust `tabindex` for `disabled` state

<!-- React and Web Component deploy previews are enabled by default. -->
<!-- To enable additional available deploy previews, apply the following -->
<!-- labels for the corresponding package: -->
<!-- *** "package: services": Services -->
<!-- *** "package: utilities": Utilities -->
<!-- *** "package: styles": Carbon Expressive -->
<!-- *** "RTL": React / Web Components (RTL) -->
<!-- *** "feature flag": React / Web Components (experimental) -->
  • Loading branch information
ariellalgilmore authored Apr 27, 2021
1 parent c0ec381 commit 8f3ae96
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,15 @@ class DDSTabsExtended extends StableSelectorMixin(LitElement) {
'bx--tabs__nav-item--disabled': disabled,
});
return html`
<li class="${classes}" data-target=".tab-${index}-default" role="tab" aria-selected="true" ?disabled="${disabled}">
<li class="${classes}" data-target=".tab-${index}-default" role="tab" ?disabled="${disabled}">
<a
tabindex="${index + 1}"
tabindex="${disabled ? -1 : index + 1}"
id="tab-link-${index}-default"
class="${prefix}--tabs__nav-link"
href="javascript:void(0)"
role="tab"
aria-controls="tab-panel-${index}-default"
aria-selected="${active}"
@click="${e => this._handleClick(index, e)}"
>${label}</a
>
Expand Down

0 comments on commit 8f3ae96

Please sign in to comment.