From 877a9bae92681551ca6f9315dd64cf262c2b0924 Mon Sep 17 00:00:00 2001 From: cipchk Date: Sun, 22 Apr 2018 00:29:27 +0800 Subject: [PATCH] fix(module:checkbox): fix invalid setting width via style --- components/checkbox/nz-checkbox-wrapper.component.ts | 9 +++++---- components/checkbox/nz-checkbox.spec.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/checkbox/nz-checkbox-wrapper.component.ts b/components/checkbox/nz-checkbox-wrapper.component.ts index a0568eb8ec..694b631963 100644 --- a/components/checkbox/nz-checkbox-wrapper.component.ts +++ b/components/checkbox/nz-checkbox-wrapper.component.ts @@ -6,10 +6,11 @@ import { NzCheckboxComponent } from './nz-checkbox.component'; selector : 'nz-checkbox-wrapper', preserveWhitespaces: false, template : ` -
- -
- ` + + `, + host: { + '[class.ant-checkbox-group]': 'true' + } }) export class NzCheckboxWrapperComponent { @Output() nzOnChange = new EventEmitter(); diff --git a/components/checkbox/nz-checkbox.spec.ts b/components/checkbox/nz-checkbox.spec.ts index a43c1236a2..da43486ee5 100644 --- a/components/checkbox/nz-checkbox.spec.ts +++ b/components/checkbox/nz-checkbox.spec.ts @@ -251,7 +251,7 @@ describe('checkbox', () => { inputElement = checkboxWrapper.nativeElement.querySelector('input') as HTMLInputElement; })); it('should className correct', fakeAsync(() => { - expect(checkboxWrapper.nativeElement.firstElementChild.classList).toContain('ant-checkbox-group'); + expect(checkboxWrapper.nativeElement.classList).toContain('ant-checkbox-group'); })); it('should onChange correct', fakeAsync(() => { inputElement.click();