tdesign-react icon indicating copy to clipboard operation
tdesign-react copied to clipboard

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

Open menghaor opened this issue 1 year ago • 4 comments

tdesign-react 版本

^1.9.3

重现链接

No response

重现步骤

No response

期望结果

No response

实际结果

No response

框架版本

18.3.1

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

image

menghaor avatar Nov 21 '24 06:11 menghaor

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

github-actions[bot] avatar Nov 21 '24 06:11 github-actions[bot]

问题是什么?

uyarn avatar Nov 24 '24 14:11 uyarn

+1, 改变 SubMenuMenuItem 的高度,会导致 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>

yiyungent avatar Dec 01 '24 17:12 yiyungent

遇到了同样的问题

cllee1214 avatar Dec 25 '24 08:12 cllee1214