Skip to content

Commit

Permalink
fix: Prefer flipping submenu to left side over to the bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
frankieyan committed Dec 12, 2024
1 parent 75441cd commit 1a0505a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/menu/menu.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ be changed by passing `modal={false}` to `<MenuList>`

You may nest the `<SubMenu>` component within `<Menu>` to create submenus.

On smaller viewports where there isn't enough space to render the submenu on the side, it will be rendered under its parent menu item instead.
On smaller viewports where there isn't enough space to render the submenu on either side, it will be rendered under its parent menu item instead.

<Canvas>
<Story
Expand Down
2 changes: 1 addition & 1 deletion src/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ const MenuList = React.forwardRef<HTMLDivElement, MenuListProps>(function MenuLi
className={classNames('reactist_menulist', exceptionallySetClassName)}
getAnchorRect={getAnchorRect ?? undefined}
modal={modal}
flip={flip ?? (isSubMenu ? 'bottom' : undefined)}
flip={flip ?? (isSubMenu ? 'left bottom' : undefined)}
/>
</Portal>
) : null
Expand Down

0 comments on commit 1a0505a

Please sign in to comment.