【问题标题】:Override mat-button remove the grey background覆盖垫按钮删除灰色背景
【发布时间】:2023-02-20 20:19:04
【问题描述】:
我有一个打开的模式,但打开后,“返回”按钮始终具有灰色背景。但是,当我在模态外单击时,它会消失。如何去除灰色背景。
【问题讨论】:
标签:
html
css
angular
angular-material
【解决方案1】:
这是Materials autoFocus 属性。像这样禁用它:
const dialogRef = this.dialog.open(DialogOverviewExampleDialog, {
width: '250px',
data: {name: this.name, animal: this.animal},
autoFocus: false
});
autoFocus: false 可以解决问题。
自动对焦:真(默认)
自动对焦:假