@@ -91,7 +91,8 @@ export default {
containerVisible: this.visible,
maximized: false,
focusableMax: null,
- focusableClose: null
+ focusableClose: null,
+ target: null
};
},
watch: {
@@ -113,6 +114,7 @@ export default {
documentDragEndListener: null,
lastPageX: null,
lastPageY: null,
+ maskMouseDownTarget: null,
updated() {
if (this.visible) {
this.containerVisible = this.visible;
@@ -146,6 +148,7 @@ export default {
},
onEnter() {
this.$emit('show');
+ this.target = document.activeElement;
this.focus();
this.enableDocumentSettings();
this.bindGlobalListeners();
@@ -161,6 +164,8 @@ export default {
},
onLeave() {
this.$emit('hide');
+ DomHandler.focus(this.target);
+ this.target = null;
this.focusableClose = null;
this.focusableMax = null;
},
@@ -174,8 +179,11 @@ export default {
this.unbindGlobalListeners();
this.$emit('after-hide');
},
- onMaskClick(event) {
- if (this.dismissableMask && this.modal && this.mask === event.target) {
+ onMaskMouseDown(event) {
+ this.maskMouseDownTarget = event.target;
+ },
+ onMaskMouseUp() {
+ if (this.dismissableMask && this.modal && this.mask === this.maskMouseDownTarget) {
this.close();
}
},
diff --git a/packages/primevue/src/drawer/Drawer.vue b/packages/primevue/src/drawer/Drawer.vue
index 635a20c6e..acd1aa592 100755
--- a/packages/primevue/src/drawer/Drawer.vue
+++ b/packages/primevue/src/drawer/Drawer.vue
@@ -31,7 +31,7 @@
-