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(numfmt): numfmt not render after auto fill (#2617)

Gpound.liu111bc9f4ee61
diff --git a/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts b/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
index 442201df3f..f8c393e8ad 100644
--- a/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
+++ b/packages/sheets-numfmt/src/controllers/numfmt.cell-content.controller.ts
@@ -14,8 +14,11 @@
* limitations under the License.
*/
-import type { ICellData, ICellDataForSheetInterceptor,
- Workbook } from '@univerjs/core';
+import type {
+ ICellData,
+ ICellDataForSheetInterceptor,
+ Workbook,
+} from '@univerjs/core';
import {
CellValueType,
Disposable,
@@ -29,8 +32,8 @@ import {
ThemeService,
UniverInstanceType,
} from '@univerjs/core';
-import type { ISetNumfmtMutationParams } from '@univerjs/sheets';
-import { INTERCEPTOR_POINT, INumfmtService, SetNumfmtMutation, SheetInterceptorService } from '@univerjs/sheets';
+import type { ISetNumfmtMutationParams, ISetRangeValuesMutationParams } from '@univerjs/sheets';
+import { INTERCEPTOR_POINT, INumfmtService, SetNumfmtMutation, SetRangeValuesMutation, SheetInterceptorService } from '@univerjs/sheets';
import { Inject } from '@wendellhu/redi';
import { of, skip, switchMap } from 'rxjs';
@@ -112,6 +115,11 @@ export class SheetsNumfmtCellContentController extends Disposable {
});
});
});
+ } else if (commandInfo.id === SetRangeValuesMutation.id) {
+ const params = commandInfo.params as ISetRangeValuesMutationParams;
+ new ObjectMatrix(params.cellValue).forValue((row, col) => {
+ renderCache.realDeleteValue(row, col);
+ });
}
}));