Skip to content

Commit f5bcfc8

Browse files
authored
Merge pull request #2603 from Akshat55/tab-aria
fix: Correct left button title
2 parents 50e170a + a8c8715 commit f5bcfc8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/tabs/tab-headers.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { Tab } from "./tab.component";
3939
[ngClass]="{
4040
'cds--tab--overflow-nav-button--hidden': leftOverflowNavButtonHidden
4141
}"
42-
[title]="translations.BUTTON_ARIA_RIGHT">
42+
[title]="translations.BUTTON_ARIA_LEFT">
4343
<svg
4444
focusable="false"
4545
preserveAspectRatio="xMidYMid meet"

src/tabs/tab.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
HostBinding
99
} from "@angular/core";
1010

11-
let nextId = 0;
12-
1311
/**
1412
* The `Tab` component is a child of the `Tabs` component.
1513
* It represents one `Tab` item and its content within a panel of other `Tab` items.
@@ -70,6 +68,7 @@ let nextId = 0;
7068
`
7169
})
7270
export class Tab implements OnInit {
71+
private static counter = 0;
7372
/**
7473
* Boolean value reflects if the `Tab` is using a custom template for the heading.
7574
* Default value is false.
@@ -102,11 +101,10 @@ export class Tab implements OnInit {
102101
@Input() disabled = false;
103102

104103
@Input() tabIndex = 0;
105-
// do we need id's?
106104
/**
107105
* Sets the id of the `Tab`. Will be uniquely generated if not provided.
108106
*/
109-
@Input() id = `n-tab-${nextId++}`;
107+
@Input() id = `n-tab-${Tab.counter++}`;
110108
/**
111109
* Set to true to have Tab items cached and not reloaded on tab switching.
112110
*/

0 commit comments

Comments
 (0)