Skip to content

Commit

Permalink
refactor(MenuItem): rename prop
Browse files Browse the repository at this point in the history
  • Loading branch information
YossiSaadi committed Jan 15, 2025
1 parent 02eba3d commit ab56960
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 2 additions & 4 deletions packages/core/src/components/Menu/MenuItem/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ export interface MenuItemProps extends VibeComponentProps {
"aria-label"?: AriaAttributes["aria-label"];
submenuPosition?: SubmenuPosition;
/**
* Enables the observation of content resize for the menu item's submenu.
* When set to `true`, a ResizeObserver is attached to the popper content,
* automatically triggering repositioning when the size of the submenu's content changes.
* When set to `true`, submenu's content and size changes would automatically trigger repositioning.
*
* This is useful for when submenu's content may grow or shrink without a re-render being triggered.
*/
observeSubMenuContentResize?: boolean;
autoAdjustOnSubMenuContentResize?: boolean;
}

export interface MenuItemTitleComponentProps extends Omit<MenuItemProps, "title"> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const MenuItemSubMenu = ({
onClose,
children,
submenuPosition,
observeSubMenuContentResize
autoAdjustOnSubMenuContentResize
}: MenuItemSubMenuProps) => {
const childRef = useRef<HTMLDivElement>(null);
const popperElementRef = useRef<HTMLDivElement>(null);
Expand All @@ -38,7 +38,7 @@ const MenuItemSubMenu = ({
{
isOpen: open,
placement: submenuPlacement,
observeContentResize: observeSubMenuContentResize
observeContentResize: autoAdjustOnSubMenuContentResize
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CloseMenuOption, MenuChild } from "../../../Menu/MenuConstants";
import { SubmenuPosition } from "../../MenuItem.types";
import { MenuItemProps } from "../../MenuItem";

export interface MenuItemSubMenuProps extends Pick<MenuItemProps, "observeSubMenuContentResize"> {
export interface MenuItemSubMenuProps extends Pick<MenuItemProps, "autoAdjustOnSubMenuContentResize"> {
/**
* Reference to the anchor element that the submenu is related to. This is used to position the submenu correctly relative to the parent menu item.
*/
Expand Down

0 comments on commit ab56960

Please sign in to comment.