Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tabs): set fixed tab and tabpanel values for native role attribute #1119

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/oruga/src/components/tabs/TabItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const props = withDefaults(defineProps<TabItemProps<T, C>>(), {
icon: () => getDefault("tabs.icon"),
iconPack: () => getDefault("tabs.iconPack"),
tag: () => getDefault("tabs.itemTag", "button"),
ariaRole: () => getDefault("tabs.ariaRole", "tabpanel"),
content: undefined,
component: undefined,
props: undefined,
Expand Down Expand Up @@ -164,9 +163,11 @@ const panelClasses = defineClasses(["tabPanelClass", "o-tabs__panel"]);
v-show="isActive && visible"
v-bind="$attrs"
:id="`tabpanel-${item.identifier}`"
data-oruga="tabs-item"
:class="panelClasses"
role="tabpanel"
:data-id="`tabs-${item.identifier}`"
data-oruga="tabs-item"
:hidden="!isActive"
:aria-labelledby="`tab-${item.identifier}`"
aria-roledescription="item">
<!--
Expand Down
2 changes: 1 addition & 1 deletion packages/oruga/src/components/tabs/Tabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ const contentClasses = defineClasses(
:id="`tab-${childItem.identifier}`"
:key="childItem.identifier"
:class="childItem.navClasses"
:role="childItem.ariaRole"
role="tab"
:aria-controls="`tabpanel-${childItem.identifier}`"
:aria-selected="childItem.value === activeItem.value">
<o-slot-component
Expand Down
2 changes: 0 additions & 2 deletions packages/oruga/src/components/tabs/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ export type TabItemProps<T, C extends Component> = {
iconPack?: string;
/** Tabs item tag name */
tag?: DynamicComponent;
/** Role attribute to be passed to the div wrapper for better accessibility */
ariaRole?: string;
/** Text content, unnecessary when default slot is used */
content?: string;
/** Component to be injected. */
Expand Down
Loading