From f040d816a8079f326496e2ccb684be0c5ef93d6d Mon Sep 17 00:00:00 2001 From: Ozan Tekin Date: Wed, 18 Sep 2024 22:05:48 +0300 Subject: [PATCH] fix: align ConfirmPopup arrow directly above trigger for top position (#7215) --- components/lib/confirmpopup/ConfirmPopup.js | 2 +- components/lib/confirmpopup/ConfirmPopupBase.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/lib/confirmpopup/ConfirmPopup.js b/components/lib/confirmpopup/ConfirmPopup.js index 0cf5b68f43..1200de84d1 100644 --- a/components/lib/confirmpopup/ConfirmPopup.js +++ b/components/lib/confirmpopup/ConfirmPopup.js @@ -142,7 +142,7 @@ export const ConfirmPopup = React.memo( const onEnter = () => { ZIndexUtils.set('overlay', overlayRef.current, (context && context.autoZIndex) || PrimeReact.autoZIndex, (context && context.zIndex.overlay) || PrimeReact.zIndex.overlay); - DomHandler.addStyles(overlayRef.current, { position: 'absolute', top: '50%', left: '50%', marginTop: '10px' }); + DomHandler.addStyles(overlayRef.current, { position: 'absolute', top: '0', left: '0' }); align(); }; diff --git a/components/lib/confirmpopup/ConfirmPopupBase.js b/components/lib/confirmpopup/ConfirmPopupBase.js index c5ad494c92..91b7a15d93 100644 --- a/components/lib/confirmpopup/ConfirmPopupBase.js +++ b/components/lib/confirmpopup/ConfirmPopupBase.js @@ -4,9 +4,12 @@ import { classNames } from '../utils/Utils'; const styles = ` @layer primereact { + .p-confirm-popup { + margin-top: 10px; + } + .p-confirm-popup-flipped { - margin-top: 0; - margin-bottom: 10px; + margin-top: -10px; } .p-confirm-popup:after, .p-confirm-popup:before {