I want to prevent the autofocus on the first input element when open the PrimeNG dialog.
<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
. Set it to false
will stop focusing on the first button. Not sure which version of PrimeNG this was introduced in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With