Skip to content

Commit

Permalink
fix(layout): Fix the issue of excessively long titles not being trunc…
Browse files Browse the repository at this point in the history
…ated.

close #7365
  • Loading branch information
chenshuai2144 committed Jul 13, 2023
1 parent 8cc6c9e commit 0e67775
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.1
version: 8.6.7
- run: pnpm install
- run: pnpm run build
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.1
version: 8.6.7

- run: pnpm install
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
with:
version: 8.6.1
version: 8.6.7
- name: build
env:
TEST_UI: 'preview'
Expand Down
2 changes: 1 addition & 1 deletion packages/layout/src/components/SiderMenu/BaseMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createFromIconfontCN } from '@ant-design/icons';
import type { ProTokenType } from '@ant-design/pro-provider';
import { ProProvider } from '@ant-design/pro-provider';
import { isImg, isUrl, useMountMergeState } from '@ant-design/pro-utils';
import type { MenuProps} from 'antd';
import type { MenuProps } from 'antd';
import { Menu, Skeleton, Tooltip } from 'antd';
import type { ItemType } from 'antd/lib/menu/hooks/useItems';
import classNames from 'classnames';
Expand Down
11 changes: 8 additions & 3 deletions packages/layout/src/components/SiderMenu/style/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ const genProLayoutBaseMenuStyle: GenerateStyle<ProLayoutBaseMenuToken> = (
flexDirection: 'row',
alignItems: 'center',
gap: token.marginXS,
[`${token.componentCls}-item-text`]: {
maxWidth: '100%',
textOverflow: 'ellipsis',
overflow: 'hidden',
wordBreak: 'break-all',
whiteSpace: 'nowrap',
},
'&-collapsed': {
flexDirection: 'column',
justifyContent: 'center',
Expand All @@ -86,9 +93,7 @@ const genProLayoutBaseMenuStyle: GenerateStyle<ProLayoutBaseMenuToken> = (
height: '16px',
},
},
[`${token.componentCls}-item-text`]: {
maxWidth: '100%',
},

[`${token.componentCls}-item-text-has-icon`]: {
display: 'none !important',
},
Expand Down

0 comments on commit 0e67775

Please sign in to comment.