Skip to content

Commit

Permalink
fix(Menu): fixed height issue with drilldown examples (#8033)
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye authored Oct 10, 2022
1 parent b44f6c3 commit c0583b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
};
Expand Down

0 comments on commit c0583b5

Please sign in to comment.