Skip to content

Commit eeba295

Browse files
emyarodjoshblack
authored andcommitted
fix(tabs): replace wrapper nav (#2853)
1 parent 0a8606f commit eeba295

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
1-
<!--
1+
<!--
22
Copyright IBM Corp. 2016, 2018
33
44
This source code is licensed under the Apache-2.0 license found in the
55
LICENSE file in the root directory of this source tree.
66
-->
77

8-
<nav data-tabs class="{{@root.prefix}}--tabs" role="navigation">
8+
<div data-tabs class="{{@root.prefix}}--tabs">
99
<div class="{{@root.prefix}}--tabs-trigger" tabindex="0">
1010
<a href="javascript:void(0)" class="{{@root.prefix}}--tabs-trigger-text" tabindex="-1"></a>
1111
{{ carbon-icon 'ChevronDownGlyph' }}
1212
</div>
1313
<ul class="{{@root.prefix}}--tabs__nav {{@root.prefix}}--tabs__nav--hidden" role="tablist">
1414
{{#each items}}
15-
<li class="{{@root.prefix}}--tabs__nav-item{{#if selected}} {{@root.prefix}}--tabs__nav-item--selected{{/if}} {{#if disabled}} {{@root.prefix}}--tabs__nav-item--disabled {{/if}}" data-target=".{{panelClass}}" role="presentation">
16-
<a tabindex="0" id="{{linkId}}" class="{{@root.prefix}}--tabs__nav-link" href="javascript:void(0)" role="tab" aria-controls="{{panelId}}"{{#if selected}} aria-selected="true"{{/if}}>{{label}}</a>
17-
</li>
15+
<li
16+
class="{{@root.prefix}}--tabs__nav-item{{#if selected}} {{@root.prefix}}--tabs__nav-item--selected{{/if}} {{#if disabled}} {{@root.prefix}}--tabs__nav-item--disabled {{/if}}"
17+
data-target=".{{panelClass}}" role="presentation">
18+
<a tabindex="0" id="{{linkId}}" class="{{@root.prefix}}--tabs__nav-link" href="javascript:void(0)" role="tab"
19+
aria-controls="{{panelId}}" {{#if selected}} aria-selected="true" {{/if}}>{{label}}</a>
20+
</li>
1821
{{/each}}
1922
</ul>
20-
</nav>
23+
</div>
2124
<!-- The markup below is for demonstration purposes only -->
2225
<div>
2326
{{#each items}}
24-
<div id="{{panelId}}" class="{{panelClass}}" role="tabpanel" aria-labelledby="{{linkId}}" aria-hidden="{{not selected}}"{{#if (not selected)}} hidden{{/if}}>
25-
<p style="padding: 0 1rem; font-size: 14px; font-weight: 600;">{{panelContent}}</p>
26-
</div>
27+
<div id="{{panelId}}" class="{{panelClass}}" role="tabpanel" aria-labelledby="{{linkId}}"
28+
aria-hidden="{{not selected}}" {{#if (not selected)}} hidden{{/if}}>
29+
<p style="padding: 0 1rem; font-size: 14px; font-weight: 600;">{{panelContent}}</p>
30+
</div>
2731
{{/each}}
2832
</div>

packages/react/src/components/Tabs/Tabs.Skeleton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class TabsSkeleton extends React.Component {
1818
</li>
1919
);
2020
return (
21-
<nav className={`${prefix}--tabs ${prefix}--skeleton`}>
21+
<div className={`${prefix}--tabs ${prefix}--skeleton`}>
2222
<div className={`${prefix}--tabs-trigger`}>
2323
<div className={`${prefix}--tabs-trigger-text`}>&nbsp;</div>
2424
<svg width="10" height="5" viewBox="0 0 10 5" fillRule="evenodd">
@@ -34,7 +34,7 @@ export default class TabsSkeleton extends React.Component {
3434
{tab}
3535
{tab}
3636
</ul>
37-
</nav>
37+
</div>
3838
);
3939
}
4040
}

0 commit comments

Comments
 (0)