Skip to content

Menu组件submenu css max-height: 计算问题 #3222

Done

Description

@menghaor

tdesign-react 版本

^1.9.3

重现链接

No response

重现步骤

No response

期望结果

No response

实际结果

No response

框架版本

18.3.1

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

image

Activity

  1. github-actions commented on Nov 21, 2024

    @github-actions
    Contributor

    👋 @menghaor,感谢给 TDesign 提出了 issue。
    请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

  2. uyarn commented on Nov 24, 2024

    @uyarn
    Collaborator

    问题是什么?

  3. yiyungent commented on Dec 1, 2024

    @yiyungent

    +1, 改变 SubMenu 中 MenuItem 的高度,会导致 SubMenu 展开时的 max-height 计算错误,从而导致最底部部分被遮挡
    @uyarn

    目前我这么临时解决

    const MenuItemPlus = (props: any) => {
      return (
        <MenuItem
          {...props}
          style={{
            height: "52px",
            lineHeight: "52px",
            color: "#222",
            fontWeight: 300,
            fontSize: "18px",
          }}
        />
      );
    };
    
    <SubMenu
      title="基础信息"
      value="2-1"
      icon={<ServerIcon />}
      className={css`
        &.t-is-opened {
          ul.t-menu__sub {
            max-height: max-content !important;
          }
        }
      `}
    >
      <MenuItemPlus value="2-1-1">基础列表项</MenuItemPlus>
      <MenuItemPlus value="2-1-2">卡片列表项</MenuItemPlus>
      <MenuItemPlus value="2-1-3">筛选列表项</MenuItemPlus>
      <MenuItemPlus value="2-1-4">树状筛选列表项</MenuItemPlus>
    </SubMenu>
  4. cllee1214 commented on Dec 25, 2024

    @cllee1214

    遇到了同样的问题

  5. added
    🐞 bug
    and removed
    💭 discussion
    on Nov 27, 2025
  6. RylanBot commented on Nov 26, 2026

    @RylanBot
    Collaborator

    1.19.0 已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions