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.

feat: func addFloatDomToPosition may not execute command (#3855)

YuHonge99aec17661b
diff --git a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
index 92e53cb232..6d39a81216 100644
--- a/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
+++ b/packages/sheets-drawing-ui/src/services/canvas-float-dom-manager.service.ts
@@ -492,7 +492,7 @@ export class SheetCanvasFloatDomManagerService extends Disposable {
);
}
- addFloatDomToPosition(layer: ICanvasFloatDom, propId?: string) {
+ addFloatDomToPosition(layer: ICanvasFloatDom, propId?: string, executeCommand = true) {
const target = getSheetCommandTarget(this._univerInstanceService, {
unitId: layer.unitId,
subUnitId: layer.subUnitId,
@@ -528,17 +528,18 @@ export class SheetCanvasFloatDomManagerService extends Disposable {
data,
allowTransform,
};
-
- this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
- unitId,
- drawings: [sheetDrawingParam],
- } as IInsertDrawingCommandParams);
-
+ if (executeCommand) {
+ this._commandService.executeCommand(InsertSheetDrawingCommand.id, {
+ unitId,
+ drawings: [sheetDrawingParam],
+ } as IInsertDrawingCommandParams);
+ }
return {
id,
dispose: () => {
this._removeDom(id, true);
},
+ sheetDrawingParam,
};
}