From 57b5938d0bb0bb906217db350280392361cdafc6 Mon Sep 17 00:00:00 2001 From: CooperHash <2597905281@qq.com> Date: Sun, 17 Mar 2024 11:36:17 +0800 Subject: [PATCH] fix:submenu overflow popupoffset --- docs/examples/antd.tsx | 1 + src/Menu.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/examples/antd.tsx b/docs/examples/antd.tsx index f5bd0bba..f83aa842 100644 --- a/docs/examples/antd.tsx +++ b/docs/examples/antd.tsx @@ -174,6 +174,7 @@ export class CommonMenu extends React.Component< onOpenChange={onOpenChange} selectedKeys={['3']} overflowedIndicator={overflowedIndicator} + overflowPopupOffset={[10, 15]} {...this.props} > {children} diff --git a/src/Menu.tsx b/src/Menu.tsx index aa50e63b..1fb89658 100644 --- a/src/Menu.tsx +++ b/src/Menu.tsx @@ -107,6 +107,7 @@ export interface MenuProps forceSubMenuRender?: boolean; triggerSubMenuAction?: TriggerSubMenuAction; builtinPlacements?: BuiltinPlacements; + overflowPopupOffset?: number[] // Icon itemIcon?: RenderIconType; @@ -205,6 +206,7 @@ const Menu = React.forwardRef((props, ref) => { // Popup triggerSubMenuAction = 'hover', builtinPlacements, + overflowPopupOffset, // Icon itemIcon, @@ -589,6 +591,7 @@ const Menu = React.forwardRef((props, ref) => { disabled={allVisible} internalPopupClose={len === 0} popupClassName={overflowedIndicatorPopupClassName} + popupOffset={overflowPopupOffset || [10, 15]} > {originOmitItems}