Skip to content

Commit

Permalink
fix(module:transfer): fix click checkbox can't trigger selection (#3030)
Browse files Browse the repository at this point in the history
close #3026
  • Loading branch information
cipchk authored and vthinkxie committed Mar 6, 2019
1 parent 2636d5f commit f077294
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions components/transfer/nz-transfer-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
</div>
<ul class="ant-transfer-list-content">
<ng-container *ngFor="let item of dataSource">
<li *ngIf="!item._hiden" (click)="_handleSelect(item)"
<li *ngIf="!item._hiden"
class="ant-transfer-list-content-item" [ngClass]="{'ant-transfer-list-content-item-disabled': disabled || item.disabled}">
<label nz-checkbox [nzChecked]="item.checked" [nzDisabled]="disabled || item.disabled">
<label nz-checkbox [nzChecked]="item.checked" (nzCheckedChange)="_handleSelect(item)" [nzDisabled]="disabled || item.disabled">
<ng-container *ngIf="!render; else renderContainer">{{ item.title }}</ng-container>
<ng-template #renderContainer [ngTemplateOutlet]="render" [ngTemplateOutletContext]="{ $implicit: item }"></ng-template>
</label>
Expand Down
4 changes: 2 additions & 2 deletions components/transfer/transfer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('transfer', () => {
fixture.detectChanges();
expect(pageObject.getEl('[data-direction="right"] .ant-transfer-list-header .ant-checkbox').classList).not.toContain('ant-checkbox-checked');
pageObject.checkItem('right', 1);
tick();
tick(50);
fixture.detectChanges();
expect(pageObject.getEl('[data-direction="right"] .ant-transfer-list-header .ant-checkbox').classList).toContain('ant-checkbox-checked');
}));
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('transfer', () => {
if (!Array.isArray(index)) {
index = [ index ];
}
const items = (direction === 'left' ? this.leftList : this.rightList).querySelectorAll('.ant-transfer-list-content-item');
const items = (direction === 'left' ? this.leftList : this.rightList).querySelectorAll('.ant-transfer-list-content-item label');
for (const idx of index) {
(items[ idx ] as HTMLElement).click();
fixture.detectChanges();
Expand Down

0 comments on commit f077294

Please sign in to comment.