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): confirm-part crash when merge cells (#5217)

ZhangWei1a7aa935f6ff
diff --git a/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx b/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
index 30e7fa2d86..327c38c2cb 100644
--- a/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
+++ b/packages/ui/src/views/components/confirm-part/ConfirmPart.tsx
@@ -29,7 +29,7 @@ const ContextConfirm = (props: IContextConfirmProps) => {
const [hooks] = useState<IConfirmChildrenProps['hooks']>({});
// eslint-disable-next-line react/no-clone-element
- const childrenWithHooks = React.cloneElement(children, { hooks });
+ const childrenWithHooks = children ? React.cloneElement(children, { hooks }) : null;
return (
<Confirm