【发布时间】:2019-01-12 08:21:01
【问题描述】:
这段代码曾经一次可以工作,所以我想我已经被 PrimeNG 的更新所困扰,这对我来说已经破坏了一些东西。曾经可用的确认对话框现在隐藏在灰色的点击掩码后面,使屏幕上的所有内容都无法点击:
这两个对话框的 HTML 如下所示:
<p-dialog header="Save Location" [modal]="true" [(visible)]="showSaveDialog" width="350" height="190">
<div style="height: 60px;">
Save location as:
<ks-dropdown #saveNameDropdown [(ngModel)]="selectedName" [options]="saveDialogNames" [editable]="true" [style]="{width: '200px'}"></ks-dropdown>
<br><br><p-checkbox [(ngModel)]="makeDefault" binary="true" label="Make this the default location"></p-checkbox>
</div>
<p-footer>
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button type="button" pButton icon="far fa-window-close" (click)="showSaveDialog=false" label="Cancel"></button>
<button type="button" pButton icon="fas fa-check" (click)="doSave()" label="OK" [disabled]="!selectedName.trim()"></button>
</div>
</p-footer>
<p-confirmDialog header="Same location name in use" icon="fas fa-question-circle" width="400"></p-confirmDialog>
</p-dialog>
启动确认对话框的代码如下所示:
if (_.find(this.app.locations, {name: this.selectedName })) {
this.confirmationService.confirm({
message: `Are you sure you want to replace the existing "${this.selectedName}"?`,
accept: () => this.completeSave()
});
}
我尝试将对话框的z-index 设置为高于出现的ui-dialog-mask div,但这没有帮助。
我也许可以通过在 DOM 中搜索有问题的ui-dialog-mask 来解决一些问题,但如果其他人可以看到我可能做错了什么,或者有更好的解决方案,我宁愿不这样做。
【问题讨论】:
-
尝试在 PrimeNG 问题跟踪器上创建问题,我们会进行审核。
-
我不确定如何创建问题跟踪器(这是 Pro 支持功能吗?),但我至少在 PrimeNG 论坛中发布了同样的问题:forum.primefaces.org/viewtopic.php?f=35&t=56546
标签: javascript css angular typescript primeng