Skip to content

Commit 03c7681

Browse files
authored
fix(tab-headers): add title attributes
2 parents 820d2a1 + d60feef commit 03c7681

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/tabs/tab-headers.component.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ComponentFixture, TestBed } from "@angular/core/testing";
2-
2+
import { I18nModule } from "../i18n/index";
33
import { UtilsModule } from "carbon-components-angular/utils";
44
import { TabHeaders } from "./tab-headers.component";
55

@@ -10,7 +10,10 @@ describe("TabHeadersComponent", () => {
1010
beforeEach(() => {
1111
TestBed.configureTestingModule({
1212
declarations: [TabHeaders],
13-
imports: [UtilsModule],
13+
imports: [
14+
UtilsModule,
15+
I18nModule
16+
],
1417
providers: []
1518
});
1619

src/tabs/tab-headers.component.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
ChangeDetectorRef
1616
} from "@angular/core";
1717
import { EventService } from "carbon-components-angular/utils";
18-
18+
import { I18n } from "carbon-components-angular/i18n";
1919
import { Tab } from "./tab.component";
2020

2121
/**
@@ -37,6 +37,7 @@ import { Tab } from "./tab.component";
3737
<button
3838
#leftOverflowNavButton
3939
type="button"
40+
[title]="translations.PREVIOUS"
4041
[ngClass]="{
4142
'bx--tab--overflow-nav-button': hasHorizontalOverflow,
4243
'bx--tab--overflow-nav-button--hidden': leftOverflowNavButtonHidden
@@ -106,6 +107,7 @@ import { Tab } from "./tab.component";
106107
<button
107108
#rightOverflowNavButton
108109
type="button"
110+
[title]="translations.NEXT"
109111
[ngClass]="{
110112
'bx--tab--overflow-nav-button': hasHorizontalOverflow,
111113
'bx--tab--overflow-nav-button--hidden': rightOverflowNavButtonHidden
@@ -163,6 +165,8 @@ export class TabHeaders implements AfterContentInit, OnChanges, OnInit {
163165

164166
@Input() type: "default" | "container" = "default";
165167

168+
@Input() translations = this.i18n.get().PAGINATION;
169+
166170
/**
167171
* Gets the Unordered List element that holds the `Tab` headings from the view DOM.
168172
*/
@@ -217,7 +221,8 @@ export class TabHeaders implements AfterContentInit, OnChanges, OnInit {
217221
constructor(
218222
protected elementRef: ElementRef,
219223
protected changeDetectorRef: ChangeDetectorRef,
220-
protected eventService: EventService
224+
protected eventService: EventService,
225+
protected i18n: I18n
221226
) { }
222227

223228
// keyboard accessibility

src/tabs/tabs.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component } from "@angular/core";
22
import { TestBed } from "@angular/core/testing";
33
import { By } from "@angular/platform-browser";
4-
4+
import { I18nModule } from "../i18n/index";
55
import { UtilsModule } from "carbon-components-angular/utils";
66
import { Tabs } from "./tabs.component";
77
import { CommonModule } from "@angular/common";
@@ -43,7 +43,8 @@ describe("Sample", () => {
4343
],
4444
imports: [
4545
CommonModule,
46-
UtilsModule
46+
UtilsModule,
47+
I18nModule
4748
]
4849
});
4950
});

src/tabs/tabs.module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NgModule } from "@angular/core";
22
import { CommonModule } from "@angular/common";
33
import { UtilsModule } from "carbon-components-angular/utils";
4-
4+
import { I18nModule } from "carbon-components-angular/i18n";
55
import { Tabs } from "./tabs.component";
66
import { Tab } from "./tab.component";
77
import { TabHeaders } from "./tab-headers.component";
@@ -25,7 +25,8 @@ import { TabHeaderGroup } from "./tab-header-group.component";
2525
],
2626
imports: [
2727
CommonModule,
28-
UtilsModule
28+
UtilsModule,
29+
I18nModule
2930
]
3031
})
3132
export class TabsModule {}

0 commit comments

Comments
 (0)