From 35ed317d230763862ef3b3c7338ab79613176d6d Mon Sep 17 00:00:00 2001 From: PBK-B Date: Fri, 7 Apr 2023 10:54:28 +0800 Subject: [PATCH] fix(menu): solve the problem of display being cropped by not enabling sliding in popup mode #2057 --- src/menu/Menu.tsx | 10 ++++- test/snap/__snapshots__/csr.test.jsx.snap | 48 +++++++++++------------ test/snap/__snapshots__/ssr.test.jsx.snap | 16 ++++---- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/menu/Menu.tsx b/src/menu/Menu.tsx index a6444e937d..a5f6323ee5 100644 --- a/src/menu/Menu.tsx +++ b/src/menu/Menu.tsx @@ -27,7 +27,7 @@ const Menu = forwardRefWithStatics( // 菜单宽度 const menuWidthArr = Array.isArray(width) ? width : [width, DEFAULT_MENU_WIDTH[1]]; - const { collapsed } = value; + const { collapsed, expandType } = value; return ( @@ -41,7 +41,13 @@ const Menu = forwardRefWithStatics( >
{logo &&
{logo}
} -
    +
      {children}
    {operations &&
    {operations}
    } diff --git a/test/snap/__snapshots__/csr.test.jsx.snap b/test/snap/__snapshots__/csr.test.jsx.snap index 707c84abe3..bc1a9d0b2b 100644 --- a/test/snap/__snapshots__/csr.test.jsx.snap +++ b/test/snap/__snapshots__/csr.test.jsx.snap @@ -124167,7 +124167,7 @@ exports[`csr snapshot test > csr test src/layout/_example/aside.jsx 1`] = ` />