Skip to content

Commit 129e944

Browse files
authored
fix(module:time-picker): fix AM/PM selector hide (#7701)
1 parent 11b85a4 commit 129e944

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

components/time-picker/time-picker-panel.component.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,15 @@ describe('time-picker-panel', () => {
343343
expect(listHourLi[6].classList).toContain('ant-picker-time-panel-cell-disabled');
344344
expect(listHourLi[7].classList).toContain('ant-picker-time-panel-cell-disabled');
345345
expect(listHourLi[8].classList).toContain('ant-picker-time-panel-cell-disabled');
346+
347+
fixture12Hour.detectChanges();
348+
tick(500);
349+
flush();
350+
listHourLi = panelElement.nativeElement
351+
.querySelectorAll('.ant-picker-time-panel-column')[3]
352+
.querySelectorAll('li');
353+
354+
expect(listHourLi.length).not.toBe(0);
346355
}));
347356
});
348357
});
@@ -451,6 +460,7 @@ export class NzTest12HourTimePanelComponent {
451460
[nzDisabledHours]="disabledHours"
452461
[nzDisabledMinutes]="disabledMinutes"
453462
[nzDisabledSeconds]="disabledSeconds"
463+
[nzHideDisabledOptions]="false"
454464
></nz-time-picker-panel>
455465
`,
456466
styleUrls: ['../style/index.less', './style/index.less']

components/time-picker/time-picker-panel.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export type NzTimePickerUnit = 'hour' | 'minute' | 'second' | '12-hour';
9090
<ul *ngIf="nzUse12Hours" #use12HoursListElement class="ant-picker-time-panel-column" style="position: relative;">
9191
<ng-container *ngFor="let range of use12HoursRange">
9292
<li
93-
*ngIf="!nzHideDisabledOptions"
9493
(click)="select12Hours(range)"
9594
class="ant-picker-time-panel-cell"
9695
[class.ant-picker-time-panel-cell-selected]="isSelected12Hours(range)"

0 commit comments

Comments
 (0)