From d9ec29c11cc36755e7bc870f2331121ed1e1c4bc Mon Sep 17 00:00:00 2001 From: melloware Date: Fri, 25 Nov 2022 09:44:16 -0500 Subject: [PATCH] Fix #3122: Prevent overlay flickering --- components/lib/dialog/Dialog.css | 5 +++++ components/lib/dialog/Dialog.js | 3 ++- components/lib/overlaypanel/OverlayPanel.css | 4 ++++ components/lib/sidebar/Sidebar.css | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/lib/dialog/Dialog.css b/components/lib/dialog/Dialog.css index 87a3c57bab..91d5a2882d 100644 --- a/components/lib/dialog/Dialog.css +++ b/components/lib/dialog/Dialog.css @@ -29,6 +29,11 @@ position: relative; } +/* Github #3122: Prevent animation flickering */ +.p-dialog:not([class*='p-dialog-']) { + display: none; +} + .p-dialog-content { overflow-y: auto; flex-grow: 1; diff --git a/components/lib/dialog/Dialog.js b/components/lib/dialog/Dialog.js index e051f0fd43..1ba9e94bfe 100644 --- a/components/lib/dialog/Dialog.js +++ b/components/lib/dialog/Dialog.js @@ -511,7 +511,8 @@ export const Dialog = React.forwardRef((props, ref) => { const otherProps = ObjectUtils.findDiffKeys(props, Dialog.defaultProps); const className = classNames('p-dialog p-component', props.className, { 'p-dialog-rtl': props.rtl, - 'p-dialog-maximized': maximized + 'p-dialog-maximized': maximized, + 'p-dialog-normal': !maximized }); const maskClassName = classNames( 'p-dialog-mask', diff --git a/components/lib/overlaypanel/OverlayPanel.css b/components/lib/overlaypanel/OverlayPanel.css index 045b672c2f..fc2421f09e 100644 --- a/components/lib/overlaypanel/OverlayPanel.css +++ b/components/lib/overlaypanel/OverlayPanel.css @@ -3,6 +3,10 @@ margin-top: 10px; } +/* Github #3122: Prevent animation flickering */ +.p-overlaypanel:not([class*='p-overlaypanel-']) { + display: none; +} .p-overlaypanel-flipped { margin-top: 0; diff --git a/components/lib/sidebar/Sidebar.css b/components/lib/sidebar/Sidebar.css index 69e44f36bd..8865d8caed 100644 --- a/components/lib/sidebar/Sidebar.css +++ b/components/lib/sidebar/Sidebar.css @@ -28,6 +28,11 @@ position: relative; } +/* Github #3122: Prevent animation flickering */ +.p-sidebar:not([class*="p-sidebar-"]){ + display: none; +} + .p-sidebar-content { overflow-y: auto; flex-grow: 1;