Skip to content

Commit

Permalink
fix(MenuItem): showing subList
Browse files Browse the repository at this point in the history
  • Loading branch information
amrelbialy committed Oct 21, 2024
1 parent 7f13413 commit 7738817
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ui/src/core/menu-item/menu-item.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const MenuItem = intrinsicComponent<MenuItemProps, HTMLDivElement>((props: MenuI
active,
value,
dividerStyle,
depth = 0,
} = props;
const menuItemRef = useRef<HTMLDivElement | null>(null);

Expand Down Expand Up @@ -68,13 +69,15 @@ const MenuItem = intrinsicComponent<MenuItemProps, HTMLDivElement>((props: MenuI
enableOverlay={false}
{...option.subMenuProps}
>
<MenuItem list={option.subList} depth={newDepthLevel} {...props} />
<MenuItem {...props} list={option.subList} depth={newDepthLevel} />
</Menu>
);
}

if (option.content === 'divider') {
return <Styled.MenuItemWrapper divider key={option.key} style={option.dividerStyle} />;
}

return (
<Styled.MenuItemWrapper
disabled={false}
Expand Down Expand Up @@ -136,7 +139,7 @@ const MenuItem = intrinsicComponent<MenuItemProps, HTMLDivElement>((props: MenuI
);
}

return <>{renderItems(list, 0)}</>;
return <>{renderItems(list, depth)}</>;
});

MenuItem.displayName = 'MenuItem';
Expand Down

0 comments on commit 7738817

Please sign in to comment.