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(chart): fix delete drawing not dispose popup (#4194)

VicKunb653da51d286
diff --git a/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts b/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
index 7e7b4b1395..dec6d4911c 100644
--- a/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
+++ b/packages/sheets-drawing-ui/src/controllers/drawing-popup-menu.controller.ts
@@ -152,6 +152,13 @@ export class DrawingPopupMenuController extends RxDisposable {
this._drawingManagerService.focusDrawing(null);
})
);
+ this.disposeWithMe(
+ this._contextService.contextChanged$.subscribe((event) => {
+ if (event[FOCUSING_COMMON_DRAWINGS] === false) {
+ singletonPopupDisposer?.dispose();
+ }
+ })
+ );
this.disposeWithMe(
transformer.changing$.subscribe(() => {
singletonPopupDisposer?.dispose();