diff --git a/packages/react-core/src/components/Menu/examples/MenuWithDrilldown.tsx b/packages/react-core/src/components/Menu/examples/MenuWithDrilldown.tsx index 0918400a12a..5825f42c4e9 100644 --- a/packages/react-core/src/components/Menu/examples/MenuWithDrilldown.tsx +++ b/packages/react-core/src/components/Menu/examples/MenuWithDrilldown.tsx @@ -26,7 +26,7 @@ export const MenuWithDrilldown: React.FunctionComponent = () => { }; const setHeight = (menuId: string, height: number) => { - if (menuHeights[menuId] === undefined) { + if (menuHeights[menuId] === undefined || (menuId !== 'drilldown-rootMenu' && menuHeights[menuId] !== height)) { setMenuHeights({ ...menuHeights, [menuId]: height }); } }; diff --git a/packages/react-core/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx b/packages/react-core/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx index 61ed5fc80c4..528c33ba9c8 100644 --- a/packages/react-core/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx +++ b/packages/react-core/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx @@ -55,11 +55,13 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => { setDrilldownPath(pathSansLast); setActiveMenu(toMenuId); }; + const setHeight = (menuId: string, height: number) => { - if (!menuHeights[menuId]) { + if (menuHeights[menuId] === undefined || (menuId !== 'breadcrumbs-rootMenu' && menuHeights[menuId] !== height)) { setMenuHeights({ ...menuHeights, [menuId]: height }); } }; + const drillIn = (fromMenuId: string, toMenuId: string, pathId: string) => { setMenuDrilledIn([...menuDrilledIn, fromMenuId]); setDrilldownPath([...drilldownPath, pathId]); diff --git a/packages/react-core/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx b/packages/react-core/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx index 9629b890d2a..54ba1a0fb6b 100644 --- a/packages/react-core/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx +++ b/packages/react-core/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx @@ -26,7 +26,7 @@ export const MenuWithDrilldownSubmenuFunctions: React.FunctionComponent = () => }; const setHeight = (menuId: string, height: number) => { - if (menuHeights[menuId] === undefined) { + if (menuHeights[menuId] === undefined || (menuId !== 'functions-rootMenu' && menuHeights[menuId] !== height)) { setMenuHeights({ ...menuHeights, [menuId]: height }); } };