问题描述
我有两个仅用于日历的组件,过去我可以使用PrimeNG 5直接制表。
但是,对于PrimeNG 9,其focusTrap设置为false(例如[focusTrap] =“ false”),并且onBlur关闭了覆盖图(this.calendar1.overlayVisible = false;)。 需要按两次Tab键才能转到下一个组件,Shift-Tab正常工作。
问题是当按下选项卡时,弹出/叠加层上的时间的向上箭头会抓住焦点,然后叠加层被关闭,因此需要另一个选项卡才能退出仅计时日历组件,请参见此StackBlitz:
https://stackblitz.com/edit/primeng-calendar-demo-7qcnhr?file=src/app/app.component.html
我如何遍历日历组件,弹出/叠加层是否不能像PrimeNG 5那样抓住焦点?
任何帮助将不胜感激。
感兴趣的代码是:
app.component.html
<p-calendar #calendar1 [(ngModel)]="date" [timeOnly]="true" [focusTrap]="false" (onBlur)="hideCalendar(calendar1)"></p-calendar>
<p-calendar #calendar2 [(ngModel)]="date" [timeOnly]="true" [focusTrap]="false" (onBlur)="hideCalendar(calendar2)"></p-calendar>
app.component.ts
hideCalendar(calendar: Calendar) {
calendar.overlayVisible = false;
}
干杯。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)