Skip to content

Commit

Permalink
fix(module:time-picker): fix AM/PM selector hide (#7701)
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyship authored Apr 2, 2023
1 parent 11b85a4 commit 129e944
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions components/time-picker/time-picker-panel.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ describe('time-picker-panel', () => {
expect(listHourLi[6].classList).toContain('ant-picker-time-panel-cell-disabled');
expect(listHourLi[7].classList).toContain('ant-picker-time-panel-cell-disabled');
expect(listHourLi[8].classList).toContain('ant-picker-time-panel-cell-disabled');

fixture12Hour.detectChanges();
tick(500);
flush();
listHourLi = panelElement.nativeElement
.querySelectorAll('.ant-picker-time-panel-column')[3]
.querySelectorAll('li');

expect(listHourLi.length).not.toBe(0);
}));
});
});
Expand Down Expand Up @@ -451,6 +460,7 @@ export class NzTest12HourTimePanelComponent {
[nzDisabledHours]="disabledHours"
[nzDisabledMinutes]="disabledMinutes"
[nzDisabledSeconds]="disabledSeconds"
[nzHideDisabledOptions]="false"
></nz-time-picker-panel>
`,
styleUrls: ['../style/index.less', './style/index.less']
Expand Down
1 change: 0 additions & 1 deletion components/time-picker/time-picker-panel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export type NzTimePickerUnit = 'hour' | 'minute' | 'second' | '12-hour';
<ul *ngIf="nzUse12Hours" #use12HoursListElement class="ant-picker-time-panel-column" style="position: relative;">
<ng-container *ngFor="let range of use12HoursRange">
<li
*ngIf="!nzHideDisabledOptions"
(click)="select12Hours(range)"
class="ant-picker-time-panel-cell"
[class.ant-picker-time-panel-cell-selected]="isSelected12Hours(range)"
Expand Down

0 comments on commit 129e944

Please sign in to comment.