diff --git a/components/tabs/nz-tabs-nav.component.ts b/components/tabs/nz-tabs-nav.component.ts index 4a184732af3..bce07a4b914 100644 --- a/components/tabs/nz-tabs-nav.component.ts +++ b/components/tabs/nz-tabs-nav.component.ts @@ -32,10 +32,7 @@ import { NzTabPositionMode } from './nz-tabset.component'; @Component({ selector : '[nz-tabs-nav]', preserveWhitespaces: false, - templateUrl : './nz-tabs-nav.component.html', - host : { - '[class.ant-tabs-bar]': 'true' - } + templateUrl : './nz-tabs-nav.component.html' }) export class NzTabsNavComponent implements AfterContentChecked, AfterContentInit { private _animated = true; diff --git a/components/tabs/nz-tabs.spec.ts b/components/tabs/nz-tabs.spec.ts index 6c27f1e1c87..05ed4c6a828 100644 --- a/components/tabs/nz-tabs.spec.ts +++ b/components/tabs/nz-tabs.spec.ts @@ -10,7 +10,7 @@ describe('tabs', () => { beforeEach(fakeAsync(() => { TestBed.configureTestingModule({ imports : [ NzTabsModule ], - declarations: [ NzTestTabsBasicComponent ] + declarations: [ NzTestTabsBasicComponent, NzTestTabsTabPositionLeftComponent ] }); TestBed.compileComponents(); })); @@ -461,6 +461,15 @@ describe('tabs', () => { expect(tabs.nativeElement.scrollLeft).toBe(0); })); }); + + describe('init nzTabPosition to left', () => { + it('should next and prev buttons display abnormal', () => { + const fixture = TestBed.createComponent(NzTestTabsTabPositionLeftComponent); + fixture.detectChanges(); + const tabs = fixture.debugElement.query(By.directive(NzTabSetComponent)); + expect(tabs.nativeElement.querySelector('.ant-tabs-nav-container').classList).not.toContain('ant-tabs-nav-container-scrolling'); + }); + }); }); @Component({ @@ -541,3 +550,18 @@ export class NzTestTabsBasicComponent { deselect02 = jasmine.createSpy('deselect02 callback'); array = []; } + +/** https://github.com/NG-ZORRO/ng-zorro-antd/issues/1964 **/ +@Component({ + selector: 'nz-test-tabs-tab-position-left', + template: ` + + + Content of tab {{ tab }} + + + ` +}) +export class NzTestTabsTabPositionLeftComponent { + tabs = [1, 2, 3]; +} diff --git a/components/tabs/nz-tabset.component.html b/components/tabs/nz-tabset.component.html index ced73383ff2..ab9eee0cff6 100644 --- a/components/tabs/nz-tabset.component.html +++ b/components/tabs/nz-tabset.component.html @@ -1,4 +1,6 @@ -