Skip to content

Commit cb34983

Browse files
cipchkwen
authored and
wen
committed
fix(module:table): fix row spaces (#2061)
close #2059
1 parent 69e1f5f commit cb34983

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

Diff for: components/table/nz-td.component.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<span class="ant-table-row-indent" *ngIf="nzIndentSize" [style.padding-left.px]="nzIndentSize"></span>
1+
<span class="ant-table-row-indent" *ngIf="nzIndentSize >= 0" [style.padding-left.px]="nzIndentSize"></span>
22
<label
33
*ngIf="nzShowCheckbox"
44
nz-checkbox
@@ -7,6 +7,9 @@
77
[nzIndeterminate]="nzIndeterminate"
88
(ngModelChange)="nzCheckedChange.emit($event)">
99
</label>
10+
<span
11+
*ngIf="!nzShowExpand && nzIndentSize != null"
12+
class="ant-table-row-expand-icon ant-table-row-spaced"></span>
1013
<span
1114
*ngIf="nzShowExpand"
1215
class="ant-table-row-expand-icon"

Diff for: components/table/nz-td.spec.ts

+11
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ describe('nz-td', () => {
100100
expect(td.nativeElement.querySelector('.ant-table-row-expand-icon').classList).toContain('ant-table-row-expanded');
101101
expect(testComponent.expandChange).toHaveBeenCalledTimes(1);
102102
});
103+
it('should be row index when index-size is 0', () => {
104+
testComponent.indentSize = 0;
105+
fixture.detectChanges();
106+
expect(td.nativeElement.querySelector('.ant-table-row-indent')).not.toBeNull();
107+
});
108+
it('should be keeping space when hidden expand and index-size is not null', () => {
109+
testComponent.showExpand = false;
110+
testComponent.indentSize = 0;
111+
fixture.detectChanges();
112+
expect(td.nativeElement.querySelector('.ant-table-row-expand-icon').classList).toContain('ant-table-row-spaced');
113+
});
103114
it('should indentSize work', () => {
104115
fixture.detectChanges();
105116
expect(td.nativeElement.querySelector('.ant-table-row-indent')).toBeNull();

0 commit comments

Comments
 (0)