From 2a4625780aedcca4b55f0e1dbb3aed7c2dc7e103 Mon Sep 17 00:00:00 2001 From: Alex McNerney Date: Wed, 26 Jun 2024 20:11:44 -0700 Subject: [PATCH 01/13] Fix positioning of overlay arrows --- packages/primevue/src/confirmpopup/ConfirmPopup.vue | 2 +- packages/primevue/src/confirmpopup/style/ConfirmPopupStyle.js | 2 +- packages/primevue/src/popover/style/PopoverStyle.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/primevue/src/confirmpopup/ConfirmPopup.vue b/packages/primevue/src/confirmpopup/ConfirmPopup.vue index bb8c4d62b..9464ba3aa 100644 --- a/packages/primevue/src/confirmpopup/ConfirmPopup.vue +++ b/packages/primevue/src/confirmpopup/ConfirmPopup.vue @@ -206,7 +206,7 @@ export default { arrowLeft = targetOffset.left - containerOffset.left; } - this.container.style.setProperty($dt('overlay.arrow.left').name, `${arrowLeft}px`); + this.container.style.setProperty($dt('confirmpopup.arrow.left').name, `${arrowLeft}px`); if (containerOffset.top < targetOffset.top) { this.container.setAttribute('data-p-confirmpopup-flipped', 'true'); diff --git a/packages/primevue/src/confirmpopup/style/ConfirmPopupStyle.js b/packages/primevue/src/confirmpopup/style/ConfirmPopupStyle.js index c6565d46e..1713be9b2 100644 --- a/packages/primevue/src/confirmpopup/style/ConfirmPopupStyle.js +++ b/packages/primevue/src/confirmpopup/style/ConfirmPopupStyle.js @@ -67,7 +67,7 @@ const theme = ({ dt }) => ` .p-confirmpopup:after, .p-confirmpopup:before { bottom: 100%; - left: ${dt('confirmpopup.arrow.offset')}; + left: calc(${dt('confirmpopup.arrow.offset')} + ${dt('confirmpopup.arrow.left')}); content: " "; height: 0; width: 0; diff --git a/packages/primevue/src/popover/style/PopoverStyle.js b/packages/primevue/src/popover/style/PopoverStyle.js index 3df4aef77..a2f834c9e 100644 --- a/packages/primevue/src/popover/style/PopoverStyle.js +++ b/packages/primevue/src/popover/style/PopoverStyle.js @@ -39,7 +39,7 @@ const theme = ({ dt }) => ` .p-popover:after, .p-popover:before { bottom: 100%; - left: ${dt('popover.arrow.offset')}; + left: calc(${dt('popover.arrow.offset')} + ${dt('popover.arrow.left')}); content: " "; height: 0; width: 0; From e3a52f689ed5c777200df02fcc594c73ae9eeb01 Mon Sep 17 00:00:00 2001 From: clemvnt Date: Mon, 29 Jul 2024 22:11:41 +0200 Subject: [PATCH 02/13] cherry pick --- packages/primevue/src/confirmpopup/ConfirmPopup.vue | 8 +++++++- packages/primevue/src/dialog/Dialog.vue | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/primevue/src/confirmpopup/ConfirmPopup.vue b/packages/primevue/src/confirmpopup/ConfirmPopup.vue index 42341d442..d66a8d21f 100644 --- a/packages/primevue/src/confirmpopup/ConfirmPopup.vue +++ b/packages/primevue/src/confirmpopup/ConfirmPopup.vue @@ -78,7 +78,8 @@ export default { visible: false, confirmation: null, autoFocusAccept: null, - autoFocusReject: null + autoFocusReject: null, + target: null }; }, target: null, @@ -175,6 +176,8 @@ export default { this.autoFocusAccept = this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept' ? true : false; this.autoFocusReject = this.confirmation.defaultFocus === 'reject' ? true : false; + this.target = document.activeElement; + this.bindOutsideClickListener(); this.bindScrollListener(); this.bindResizeListener(); @@ -188,6 +191,9 @@ export default { this.autoFocusAccept = null; this.autoFocusReject = null; + DomHandler.focus(this.target); + this.target = null; + this.unbindOutsideClickListener(); this.unbindScrollListener(); this.unbindResizeListener(); diff --git a/packages/primevue/src/dialog/Dialog.vue b/packages/primevue/src/dialog/Dialog.vue index 361d1db91..3fc8bb04b 100755 --- a/packages/primevue/src/dialog/Dialog.vue +++ b/packages/primevue/src/dialog/Dialog.vue @@ -91,7 +91,8 @@ export default { containerVisible: this.visible, maximized: false, focusableMax: null, - focusableClose: null + focusableClose: null, + target: null, }; }, watch: { @@ -146,6 +147,7 @@ export default { }, onEnter() { this.$emit('show'); + this.target = document.activeElement; this.focus(); this.enableDocumentSettings(); this.bindGlobalListeners(); @@ -161,6 +163,8 @@ export default { }, onLeave() { this.$emit('hide'); + DomHandler.focus(this.target); + this.target = null; this.focusableClose = null; this.focusableMax = null; }, From cf01b11db3f3fa174c13bf71b8a4085754d5a360 Mon Sep 17 00:00:00 2001 From: uros Date: Tue, 30 Jul 2024 11:34:32 +0200 Subject: [PATCH 03/13] - fix: #6116 prevent dialog from closing when releasing mouse outside the dialog and dismissableMask is set to true --- packages/primevue/src/dialog/Dialog.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/primevue/src/dialog/Dialog.vue b/packages/primevue/src/dialog/Dialog.vue index 361d1db91..15c15aed4 100755 --- a/packages/primevue/src/dialog/Dialog.vue +++ b/packages/primevue/src/dialog/Dialog.vue @@ -1,6 +1,6 @@