pull/5863/head
tugcekucukoglu 2024-06-10 10:44:46 +03:00
parent 3cd9b2d1e4
commit 760c98f998
2 changed files with 8 additions and 9 deletions

View File

@ -55,7 +55,7 @@ export default {
confirmation: null, confirmation: null,
autoFocusAccept: null, autoFocusAccept: null,
autoFocusReject: null, autoFocusReject: null,
focusElementOnHide: null target: null
}; };
}, },
target: null, target: null,
@ -151,8 +151,7 @@ export default {
onEnter(el) { onEnter(el) {
this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false; this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false;
this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false; this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false;
this.target = document.activeElement;
this.focusElementOnHide = document.activeElement;
this.bindOutsideClickListener(); this.bindOutsideClickListener();
this.bindScrollListener(); this.bindScrollListener();
@ -167,8 +166,8 @@ export default {
this.autoFocusAccept = null; this.autoFocusAccept = null;
this.autoFocusReject = null; this.autoFocusReject = null;
DomHandler.focus(this.focusElementOnHide); DomHandler.focus(this.target);
this.focusElementOnHide = null; this.target = null;
this.unbindOutsideClickListener(); this.unbindOutsideClickListener();
this.unbindScrollListener(); this.unbindScrollListener();

View File

@ -85,7 +85,7 @@ export default {
maximized: false, maximized: false,
focusableMax: null, focusableMax: null,
focusableClose: null, focusableClose: null,
focusElementOnHide: null target: null
}; };
}, },
watch: { watch: {
@ -140,7 +140,7 @@ export default {
}, },
onEnter() { onEnter() {
this.$emit('show'); this.$emit('show');
this.focusElementOnHide = document.activeElement; this.target = document.activeElement;
this.focus(); this.focus();
this.enableDocumentSettings(); this.enableDocumentSettings();
this.bindGlobalListeners(); this.bindGlobalListeners();
@ -156,8 +156,8 @@ export default {
}, },
onLeave() { onLeave() {
this.$emit('hide'); this.$emit('hide');
DomHandler.focus(this.focusElementOnHide); DomHandler.focus(this.target);
this.focusElementOnHide = null; this.target = null;
this.focusableClose = null; this.focusableClose = null;
this.focusableMax = null; this.focusableMax = null;
}, },