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(sheets-ui): make disposable property optional and handle undefined case (#5716)

白熱e93671588cd3
diff --git a/packages/sheets-ui/src/services/cell-popup-manager.service.ts b/packages/sheets-ui/src/services/cell-popup-manager.service.ts
index 87fdf9d6c8..0a74b7ea68 100644
--- a/packages/sheets-ui/src/services/cell-popup-manager.service.ts
+++ b/packages/sheets-ui/src/services/cell-popup-manager.service.ts
@@ -30,7 +30,7 @@ export interface ICellPopup extends Omit<ICanvasPopup, 'direction' | 'offset' |
export interface ICellPopupDirectionCache {
popups: ICellPopup[];
- disposable: IDisposable;
+ disposable?: IDisposable;
}
export interface ICellPopupCache {
@@ -89,7 +89,7 @@ export class CellPopupManagerService extends Disposable {
directionCache?.popups.splice(findIndex, 1);
if (directionCache.popups.length === 0) {
- directionCache.disposable.dispose();
+ directionCache.disposable?.dispose();
root[direction] = undefined;
}