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(facade): fix handling of empty selections in `onSelectionChange` method (#2066)

白熱e440e045b232
diff --git a/packages/facade/src/apis/sheets/f-workbook.ts b/packages/facade/src/apis/sheets/f-workbook.ts
index 1bad17a725..6d7cd0682b 100644
--- a/packages/facade/src/apis/sheets/f-workbook.ts
+++ b/packages/facade/src/apis/sheets/f-workbook.ts
@@ -174,10 +174,10 @@ export class FWorkbook {
if (!selections?.length) {
callback([]);
+ } else {
+ // TODO@wzhudev: filtered out ranges changes not other currently sheet
+ callback(selections!.map((s) => s.range));
}
-
- // TODO@wzhudev: filtered out ranges changes not other currently sheet
- callback(selections!.map((s) => s.range));
})
);
}