fix: sidebar menu text overflow (#3626)

This commit is contained in:
jack zhang 2024-03-06 14:37:13 +08:00 committed by GitHub
parent bcb445644c
commit d3627c5ba9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -28,7 +28,18 @@ export const SchemaInitializerButton: FC<SchemaInitializerButtonProps> = React.m
icon={typeof options.icon === 'string' ? <Icon type={options.icon as string} /> : options.icon}
{...others}
>
{compile(options.title)}
<span
style={{
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
display: 'inline-block',
width: options.icon ? 'calc(100% - 14px)' : '100%',
verticalAlign: 'bottom',
}}
>
{compile(options.title)}
</span>
</Button>
);
});

View File

@ -8,6 +8,9 @@ export const menuItemInitializer = new SchemaInitializer({
insertPosition: 'beforeEnd',
icon: 'PlusOutlined',
title: '{{t("Add menu item")}}',
style: {
width: '100%',
},
items: [
{
name: 'group',