1111 },
1212 ]"
1313 role =" navigation"
14- v-bind =" $attrs"
14+ :aria-label =" attrs['aria-label'] || 'Tabs'"
15+ v-bind =" attrsWithoutAriaLabel"
1516 @keydown.right.prevent.stop =" onRight"
1617 @keydown.left.prevent.stop =" onLeft"
1718 >
1819 <button
1920 ref =" elLeftOverflow"
20- aria-hidden =" true"
21- aria-label =" scroll left"
21+ :aria-label ="
22+ leftOverflowNavButtonHidden ? undefined : 'Scroll tabs left'
23+ "
2224 :class =" [
2325 {
2426 [`${carbonPrefix}--tab--overflow-nav-button`]: horizontalOverflow,
2527 [`${carbonPrefix}--tab--overflow-nav-button--hidden`]:
2628 leftOverflowNavButtonHidden,
2729 },
2830 ]"
29- tabIndex =" -1 "
31+ : tabIndex =" leftOverflowNavButtonHidden ? -1 : 0 "
3032 type =" button"
3133 @click.stop.prevent =" e => onOverflowClick(e, { direction: -1 })"
3234 @mousedown.stop.prevent =" e => onOverflowMouseDown(e, { direction: -1 })"
8991 />
9092 <button
9193 ref =" elRightOverflow"
92- aria-hidden =" true"
93- aria-label =" scroll right"
94+ :aria-label ="
95+ rightOverflowNavButtonHidden ? undefined : 'Scroll tabs right'
96+ "
9497 :class =" [
9598 {
9699 [`${carbonPrefix}--tab--overflow-nav-button`]: horizontalOverflow,
97100 [`${carbonPrefix}--tab--overflow-nav-button--hidden`]:
98101 rightOverflowNavButtonHidden,
99102 },
100103 ]"
101- tabIndex =" -1 "
104+ : tabIndex =" rightOverflowNavButtonHidden ? -1 : 0 "
102105 type =" button"
103106 @click =" e => onOverflowClick(e, { direction: 1 })"
104107 @mousedown =" e => onOverflowMouseDown(e, { direction: 1 })"
117120import { carbonPrefix } from ' ../../global/settings' ;
118121import { ChevronLeft16 , ChevronRight16 } from ' @carbon/icons-vue' ;
119122import {
123+ computed ,
120124 nextTick ,
121125 onBeforeUnmount ,
122126 onMounted ,
123127 onUpdated ,
124128 provide ,
125129 ref ,
130+ useAttrs ,
126131 watch ,
127132} from ' vue' ;
128133
134+ defineOptions ({
135+ inheritAttrs: false ,
136+ });
137+
129138const OVERFLOW_BUTTON_OFFSET = 40 ;
130139
131140const props = defineProps ({
@@ -152,6 +161,12 @@ const props = defineProps({
152161});
153162const emit = defineEmits ([' tab-selected' , ' tab-selected-id' ]);
154163
164+ const attrs = useAttrs ();
165+ const attrsWithoutAriaLabel = computed (() => {
166+ const { 'aria -label ': _ , ... rest } = attrs;
167+ return rest;
168+ });
169+
155170const selectedId = ref (' ' );
156171provide (' tab-selected' , selectedId);
157172/**
0 commit comments