Skip to content

Commit

Permalink
fix(module:list): fix loading style misplacement of spin (#1767)
Browse files Browse the repository at this point in the history
close #1739
  • Loading branch information
cipchk authored and vthinkxie committed Jul 2, 2018
1 parent 4eb039a commit 336cc08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/list/list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ describe('list', () => {
expect(dl.query(By.css('.ant-list-loading')) != null).toBe(value);
});
}

it('should be minimum area block when data is empty', () => {
context.nzLoading = true;
context.data = [];
fixture.detectChanges();
expect(dl.query(By.css('.ant-spin-nested-loading'))).not.toBeNull();
});
});

it('#nzDataSource', () => {
Expand Down
1 change: 1 addition & 0 deletions components/list/nz-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<ng-container *ngIf="_header; else _headerTpl">{{ _header }}</ng-container>
</div>
<nz-spin [nzSpinning]="nzLoading">
<div *ngIf="nzLoading && nzDataSource.length === 0" [style.min-height.px]="53"></div>
<div *ngIf="nzGrid; else itemsTpl" nz-row [nzGutter]="nzGrid.gutter">
<div nz-col [nzSpan]="nzGrid.span" [nzXs]="nzGrid.xs" [nzSm]="nzGrid.sm" [nzMd]="nzGrid.md" [nzLg]="nzGrid.lg" [nzXl]="nzGrid.xl" [nzXXl]="nzGrid.xxl"
*ngFor="let item of nzDataSource; let index = index">
Expand Down

0 comments on commit 336cc08

Please sign in to comment.