下面是对话框配置。如果我从配置中删除viewContainerRef,则只有我能够解决此问题。是什么原因?
this.dialogRef = this.dialog.open(myDialog, {
width: this.width,
viewContainerRef: this.viewContainerRef,
direction: 'ltr',
panelClass: 'my-dialog',
data: {
address: this.addressResponse
}
});
答案 0 :(得分:0)
尝试设置autoFocus
选项,该选项将设置对话框中的第一个可聚焦元素。
this.dialogRef = this.dialog.open(myDialog, {
autoFocus: true, // <-- add this here
width: this.width,
viewContainerRef: this.viewContainerRef,
direction: 'ltr',
panelClass: 'my-dialog',
data: {
address: this.addressResponse
}
});