From ec4be6b3a2a0a383f290ddf0ca872ec06f9a53fb Mon Sep 17 00:00:00 2001 From: VTHINKXIE Date: Fri, 1 Jun 2018 14:59:26 +0800 Subject: [PATCH] fix(module:checkbox): fix invalid setting width via style (#1577) close #1359 --- components/checkbox/nz-checkbox-wrapper.component.html | 4 +--- components/checkbox/nz-checkbox-wrapper.component.ts | 5 ++++- components/checkbox/nz-checkbox.spec.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/checkbox/nz-checkbox-wrapper.component.html b/components/checkbox/nz-checkbox-wrapper.component.html index 2c761877f8..95a0b70bdc 100644 --- a/components/checkbox/nz-checkbox-wrapper.component.html +++ b/components/checkbox/nz-checkbox-wrapper.component.html @@ -1,3 +1 @@ -
- -
\ No newline at end of file + \ No newline at end of file diff --git a/components/checkbox/nz-checkbox-wrapper.component.ts b/components/checkbox/nz-checkbox-wrapper.component.ts index a3dc584ce2..a1b0dff366 100644 --- a/components/checkbox/nz-checkbox-wrapper.component.ts +++ b/components/checkbox/nz-checkbox-wrapper.component.ts @@ -5,7 +5,10 @@ import { NzCheckboxComponent } from './nz-checkbox.component'; @Component({ selector : 'nz-checkbox-wrapper', preserveWhitespaces: false, - templateUrl : './nz-checkbox-wrapper.component.html' + templateUrl : './nz-checkbox-wrapper.component.html', + 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();