diff --git a/src/components/confirmdialog/ConfirmDialog.vue b/src/components/confirmdialog/ConfirmDialog.vue index d4fe0ca34..fc41576d5 100644 --- a/src/components/confirmdialog/ConfirmDialog.vue +++ b/src/components/confirmdialog/ConfirmDialog.vue @@ -106,11 +106,10 @@ export default { return ['p-confirm-dialog-reject', this.confirmation ? (this.confirmation.rejectClass || 'p-button-text') : null]; }, autoFocusAccept() { - return this.confirmation.defaultFocus === 'accept' ? true : false; + return (this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept') ? true : false; }, autoFocusReject() { - // backward compatibility - return this.confirmation.defaultFocus !== 'accept' ? true : false; + return this.confirmation.defaultFocus === 'reject' ? true : false; } }, components: { diff --git a/src/views/confirmdialog/ConfirmDialogDoc.vue b/src/views/confirmdialog/ConfirmDialogDoc.vue index 8338644a4..64a2923fa 100644 --- a/src/views/confirmdialog/ConfirmDialogDoc.vue +++ b/src/views/confirmdialog/ConfirmDialogDoc.vue @@ -195,7 +195,7 @@ export default { defaultFocus string - null + accept Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".