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): move event bubbling prevention from "More" menu to button (#3031)

白熱e07e0c8c0400
diff --git a/packages/ui/src/views/components/doc-bars/Toolbar.tsx b/packages/ui/src/views/components/doc-bars/Toolbar.tsx
index 534c264296..2c6940fca0 100644
--- a/packages/ui/src/views/components/doc-bars/Toolbar.tsx
+++ b/packages/ui/src/views/components/doc-bars/Toolbar.tsx
@@ -107,7 +107,7 @@ export function Toolbar(props: IToolbarProps) {
forceRender
className={styles.toolbarMore}
overlay={(
- <div className={styles.toolbarMoreContainer} onClick={(e) => e.stopPropagation()}>
+ <div className={styles.toolbarMoreContainer}>
{Object.entries(groupsByKey).map(([key, item]) => (
<div key={key} className={styles.toolbarGroup}>
{item.map(
diff --git a/packages/ui/src/views/components/doc-bars/ToolbarItem.tsx b/packages/ui/src/views/components/doc-bars/ToolbarItem.tsx
index d095e9cc0b..55a54d434c 100644
--- a/packages/ui/src/views/components/doc-bars/ToolbarItem.tsx
+++ b/packages/ui/src/views/components/doc-bars/ToolbarItem.tsx
@@ -157,6 +157,7 @@ export const ToolbarItem = forwardRef((props: IDisplayMenuItem<IMenuItem>, ref:
[styles.toolbarItemSelectButtonArrowActivated]: activated,
})}
data-disabled={disabled}
+ onClick={(e) => e.stopPropagation()}
>
<MoreDownSingle />
</div>
@@ -178,6 +179,7 @@ export const ToolbarItem = forwardRef((props: IDisplayMenuItem<IMenuItem>, ref:
[styles.toolbarItemSelectDisabled]: disabled,
[styles.toolbarItemSelectActivated]: activated,
})}
+ onClick={(e) => e.stopPropagation()}
>
<CustomLabel
icon={iconToDisplay}