Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix(ui): improve layout and overflow handling in sheet bar menu (#3823)

白熱acb4a45456d2
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
index 2d9d0a411b..9d6c18cd5f 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/SheetBarMenu.tsx
@@ -29,8 +29,8 @@ import {
SetWorksheetShowCommand,
WorksheetProtectionRuleModel,
} from '@univerjs/sheets';
-import React, { useCallback, useEffect, useState } from 'react';
import { useObservable } from '@univerjs/ui';
+import React, { useCallback, useEffect, useState } from 'react';
import { ISheetBarService } from '../../../services/sheet-bar/sheet-bar.service';
import { SheetBarButton } from '../sheet-bar-button/SheetBarButton';
@@ -51,6 +51,7 @@ export interface ISheetBarMenuProps {
export function SheetBarMenu(props: ISheetBarMenuProps) {
const { style } = props;
+
const [menu, setMenu] = useState<ISheetBarMenuItem[]>([]);
const [visible, setVisible] = useState(false);
diff --git a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/index.module.less b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/index.module.less
index d463f62ea8..7e10bc1a6f 100644
--- a/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/index.module.less
+++ b/packages/sheets-ui/src/views/sheet-bar/sheet-bar-menu/index.module.less
@@ -1,12 +1,17 @@
+@import '../../sheet-container/index.module.less';
+
@padding-left-right: 24px;
@line-height: 20px;
.sheet-bar-menu {
+ max-height: calc(100vh - @sheet-footer-bar-height);
display: grid;
gap: var(--margin-xxs);
align-items: center;
+ overflow-y: auto;
box-sizing: border-box;
+ margin: 0;
padding: var(--padding-sm);
background-color: rgb(var(--bg-color-secondary));