mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-11 01:42:34 +00:00
fix: Dialog/Confirm re-focus original element on close
This commit is contained in:
parent
dd02b1d6fe
commit
c7f9b9704f
2 changed files with 12 additions and 2 deletions
|
@ -84,7 +84,8 @@ export default {
|
|||
containerVisible: this.visible,
|
||||
maximized: false,
|
||||
focusableMax: null,
|
||||
focusableClose: null
|
||||
focusableClose: null,
|
||||
focusElementOnHide: null,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
@ -139,6 +140,7 @@ export default {
|
|||
},
|
||||
onEnter() {
|
||||
this.$emit('show');
|
||||
this.focusElementOnHide = document.activeElement;
|
||||
this.focus();
|
||||
this.enableDocumentSettings();
|
||||
this.bindGlobalListeners();
|
||||
|
@ -154,6 +156,8 @@ export default {
|
|||
},
|
||||
onLeave() {
|
||||
this.$emit('hide');
|
||||
DomHandler.focus(this.focusElementOnHide);
|
||||
this.focusElementOnHide = null;
|
||||
this.focusableClose = null;
|
||||
this.focusableMax = null;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue