Skip to content

Commit

Permalink
remove delay from panel animation as it does not in fact fix the flic…
Browse files Browse the repository at this point in the history
…kering issue.
  • Loading branch information
PVautour committed Nov 20, 2024
1 parent a0315e7 commit 0e55159
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/geoview-core/src/ui/panel/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 0e55159

Please sign in to comment.