From fa3aae408565f2dc6fe4a5a2d44f841c0e9ef72e Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 15 Nov 2021 17:25:12 +0300 Subject: [PATCH] Refactor defaultFocus value --- src/components/confirmdialog/ConfirmDialog.vue | 5 ++--- src/views/confirmdialog/ConfirmDialogDoc.vue | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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".