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: fix getting cell from viewModel (#350)

Wenzhao Hu53a573a22ac4
diff --git a/packages/base-render/src/Component/Sheets/SheetSkeleton.ts b/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
index f9733904a9..59d3a68988 100644
--- a/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
+++ b/packages/base-render/src/Component/Sheets/SheetSkeleton.ts
@@ -1428,10 +1428,16 @@ export class SpreadsheetSkeleton extends Skeleton {
}
private _setCellCache(r: number, c: number, skipBackgroundAndBorder: boolean) {
- if (!this._cellData) {
+ if (!this._worksheet) {
return true;
}
- const cell = this._cellData.getValue(r, c);
+
+ const hidden = this._worksheet.getColVisible(c) === false || this._worksheet.getRowVisible(r) === false;
+ if (hidden) {
+ return true;
+ }
+
+ const cell = this._worksheet.getCell(r, c);
if (!cell) {
return true;
}