Skip to content

Commit 4dc8876

Browse files
thatblindgeyejenny-s51
authored andcommitted
fix(Menu): fixed height issue with drilldown examples (patternfly#8033)
1 parent b46769c commit 4dc8876

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/react-core/src/components/Menu/examples/MenuWithDrilldown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const MenuWithDrilldown: React.FunctionComponent = () => {
2626
};
2727

2828
const setHeight = (menuId: string, height: number) => {
29-
if (menuHeights[menuId] === undefined) {
29+
if (menuHeights[menuId] === undefined || (menuId !== 'drilldown-rootMenu' && menuHeights[menuId] !== height)) {
3030
setMenuHeights({ ...menuHeights, [menuId]: height });
3131
}
3232
};

packages/react-core/src/components/Menu/examples/MenuWithDrilldownBreadcrumbs.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ export const MenuWithDrilldownBreadcrumbs: React.FunctionComponent = () => {
5555
setDrilldownPath(pathSansLast);
5656
setActiveMenu(toMenuId);
5757
};
58+
5859
const setHeight = (menuId: string, height: number) => {
59-
if (!menuHeights[menuId]) {
60+
if (menuHeights[menuId] === undefined || (menuId !== 'breadcrumbs-rootMenu' && menuHeights[menuId] !== height)) {
6061
setMenuHeights({ ...menuHeights, [menuId]: height });
6162
}
6263
};
64+
6365
const drillIn = (fromMenuId: string, toMenuId: string, pathId: string) => {
6466
setMenuDrilledIn([...menuDrilledIn, fromMenuId]);
6567
setDrilldownPath([...drilldownPath, pathId]);

packages/react-core/src/components/Menu/examples/MenuWithDrilldownSubmenuFunctions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const MenuWithDrilldownSubmenuFunctions: React.FunctionComponent = () =>
2626
};
2727

2828
const setHeight = (menuId: string, height: number) => {
29-
if (menuHeights[menuId] === undefined) {
29+
if (menuHeights[menuId] === undefined || (menuId !== 'functions-rootMenu' && menuHeights[menuId] !== height)) {
3030
setMenuHeights({ ...menuHeights, [menuId]: height });
3131
}
3232
};

0 commit comments

Comments
 (0)