Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:submenu overflow popupoffset #690

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/examples/antd.tsx
Expand Up @@ -174,6 +174,7 @@ export class CommonMenu extends React.Component<
onOpenChange={onOpenChange}
selectedKeys={['3']}
overflowedIndicator={overflowedIndicator}
overflowPopupOffset={[10, 15]}
{...this.props}
>
{children}
Expand Down
3 changes: 3 additions & 0 deletions src/Menu.tsx
Expand Up @@ -107,6 +107,7 @@ export interface MenuProps
forceSubMenuRender?: boolean;
triggerSubMenuAction?: TriggerSubMenuAction;
builtinPlacements?: BuiltinPlacements;
overflowPopupOffset?: number[]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a functional and naming standard, should this be provided? @MadCcc

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i refer from this

popupOffset?: number[];


// Icon
itemIcon?: RenderIconType;
Expand Down Expand Up @@ -205,6 +206,7 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
// Popup
triggerSubMenuAction = 'hover',
builtinPlacements,
overflowPopupOffset,

// Icon
itemIcon,
Expand Down Expand Up @@ -589,6 +591,7 @@ const Menu = React.forwardRef<MenuRef, MenuProps>((props, ref) => {
disabled={allVisible}
internalPopupClose={len === 0}
popupClassName={overflowedIndicatorPopupClassName}
popupOffset={overflowPopupOffset || [10, 15]}
>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the default value this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i refer rc-menu docs's demo
if not, what value is appropriate

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zombieJ @MadCcc @afc163 Pls take a look.

{originOmitItems}
</SubMenu>
Expand Down