Primeng对话框无法访问

st_*_*rke 3 angular-cli primeng typescript2.0 angular

我正在使用"primeng":"^ 4.0.0-rc.2"和"@ angular/cli":"^ 1.0.0"和angular4.当我尝试使用对话框时,对话框无法访问 - 它隐藏在叠加层后面,应阻止访问页面的其余部分.请参见下图

在此输入图像描述

我希望对话框可以点击,但手机用户界面是unlickagle.鳕鱼的片段如下所示:

HTML

 <p-confirmDialog width = "425"
                           class = 'dialog-z-index'></p-confirmDialog>
Run Code Online (Sandbox Code Playgroud)

打字稿

confirm() {
    this._confirmationSrvc.confirm(
        {
          message: `Are you sure you want to delete the phone entry? ${
              jsonStringify( this.deletionData )}`,
          header: 'Delete Confirmation',
          icon: 'fa fa-trash',
          accept: () => {
          }
        } )
  }

  onDeleteConfirm( event ): void {
    this.deletionData = event.data as IPhone
    this.isDialog = true
    if ( this.isDialog ) {
      this.confirm()
      event.confirm.resolve()
      event.source.onChangedSource.subscribe(
          changedSrc => {
            if ( this.currentData.length < 1 ) {
            }
            else {

            }
          } )

    }
    else {
      event.confirm.reject()
    }
  }
Run Code Online (Sandbox Code Playgroud)

什么可能导致这种意外行为?

谢谢

amb*_*t05 6

我想你需要把它添加到p-confirmdialog.在处理多个活动的模态时,我遇到了这个问题.

appendTo="body"
Run Code Online (Sandbox Code Playgroud)