Skip to content

Commit

Permalink
fix(module:time-picker): hidden clear icon when disabled (#5990)
Browse files Browse the repository at this point in the history
Co-authored-by: xulang <[email protected]>
  • Loading branch information
stygian-desolator and DKDavion authored Oct 30, 2020
1 parent 59aa9a5 commit 761cf40
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions components/time-picker/time-picker.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ describe('time-picker', () => {
testComponent.disabled = true;
fixture.detectChanges();
expect(timeElement.nativeElement.querySelector('input').attributes.getNamedItem('disabled')).toBeDefined();
expect(timeElement.nativeElement.querySelector('.ant-picker-clear')).not.toBeTruthy();
testComponent.disabled = false;
testComponent.nzTimePickerComponent.setDisabledState(false);
fixture.detectChanges();
Expand Down
2 changes: 1 addition & 1 deletion components/time-picker/time-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'timePicker';
<i nz-icon [nzType]="suffixIcon"></i>
</ng-container>
</span>
<span *ngIf="nzAllowEmpty && value" class="ant-picker-clear" (click)="onClickClearBtn($event)">
<span *ngIf="nzAllowEmpty && !nzDisabled && value" class="ant-picker-clear" (click)="onClickClearBtn($event)">
<i nz-icon nzType="close-circle" nzTheme="fill" [attr.aria-label]="nzClearText" [attr.title]="nzClearText"></i>
</span>
</div>
Expand Down

0 comments on commit 761cf40

Please sign in to comment.