From 04d5845fe1fccd7dad3a1e46d67a9ad2e55c7858 Mon Sep 17 00:00:00 2001 From: Pascal Vautour Date: Wed, 20 Nov 2024 09:27:16 -0500 Subject: [PATCH] remove delay from panel animation as it does not in fact fix the flickering issue. --- packages/geoview-core/src/ui/panel/panel.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/geoview-core/src/ui/panel/panel.tsx b/packages/geoview-core/src/ui/panel/panel.tsx index c2a53a9ea17..d9b379f8dcf 100644 --- a/packages/geoview-core/src/ui/panel/panel.tsx +++ b/packages/geoview-core/src/ui/panel/panel.tsx @@ -116,15 +116,12 @@ export function Panel(props: TypePanelAppProps): JSX.Element { * Update the height of the panel when the mapInfo is expanded */ useEffect(() => { - // setTimeout prevents a bug that would cause the panel to flicker. - setTimeout(() => { - const mapInfo = document.getElementById(`${mapId}-mapInfo`); + const mapInfo = document.getElementById(`${mapId}-mapInfo`); - if (panelContainerRef.current && open && mapInfo) { - const mapInfoHeight = mapInfoExpanded ? '6rem' : '3rem'; - panelContainerRef.current.style.height = `calc(100% - ${mapInfoHeight})`; - } - }, 1); + if (panelContainerRef.current && open && mapInfo) { + const mapInfoHeight = mapInfoExpanded ? '6rem' : '3rem'; + panelContainerRef.current.style.height = `calc(100% - ${mapInfoHeight})`; + } }, [mapInfoExpanded, mapSize, open, mapId]); return (