[英]PrimeNG Dialog prevent autofocus on first button
I want to prevent the autofocus on the first input element when open the PrimeNG dialog. 打开PrimeNG对话框时,我想防止自动聚焦在第一个输入元素上。
<p-dialog header="User Details" [(visible)]="displayDialog"
[responsive]="true" showEffect="fade"
[modal]="true" (onAfterHide)="onDialogHide()">
<p-button icon="fa fa-fw fa-minus"
label="Delete" class="delete-button">
</p-button>
</p-dialog>
Is there a possibility to prevent the autofocus? 有可能防止自动对焦吗?
Not sure if you're still looking for an answer but there is a focusOnShow
attribute for p-dialog which defaults to true
. 不知道您是否还在寻找答案,但是p-dialog有一个
focusOnShow
属性,默认为true
。 Set it to false
will stop focusing on the first button. 将其设置为
false
将停止专注于第一个按钮。 Not sure which version of PrimeNG this was introduced in. 不确定引入哪个版本的PrimeNG。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.