Skip to content

Commit

Permalink
Refactor #5577
Browse files Browse the repository at this point in the history
  • Loading branch information
tugcekucukoglu committed Jun 10, 2024
1 parent 3cd9b2d commit 760c98f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions components/lib/confirmpopup/ConfirmPopup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
confirmation: null,
autoFocusAccept: null,
autoFocusReject: null,
focusElementOnHide: null
target: null
};
},
target: null,
Expand Down Expand Up @@ -151,8 +151,7 @@ export default {
onEnter(el) {
this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
this.focusElementOnHide = document.activeElement;
this.target = document.activeElement;
this.bindOutsideClickListener();
this.bindScrollListener();
Expand All @@ -167,8 +166,8 @@ export default {
this.autoFocusAccept = null;
this.autoFocusReject = null;
DomHandler.focus(this.focusElementOnHide);
this.focusElementOnHide = null;
DomHandler.focus(this.target);
this.target = null;
this.unbindOutsideClickListener();
this.unbindScrollListener();
Expand Down
8 changes: 4 additions & 4 deletions components/lib/dialog/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default {
maximized: false,
focusableMax: null,
focusableClose: null,
focusElementOnHide: null
target: null
};
},
watch: {
Expand Down Expand Up @@ -140,7 +140,7 @@ export default {
},
onEnter() {
this.$emit('show');
this.focusElementOnHide = document.activeElement;
this.target = document.activeElement;
this.focus();
this.enableDocumentSettings();
this.bindGlobalListeners();
Expand All @@ -156,8 +156,8 @@ export default {
},
onLeave() {
this.$emit('hide');
DomHandler.focus(this.focusElementOnHide);
this.focusElementOnHide = null;
DomHandler.focus(this.target);
this.target = null;
this.focusableClose = null;
this.focusableMax = null;
},
Expand Down

0 comments on commit 760c98f

Please sign in to comment.