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-data-validation): data-validation status change event not triggered (#4928)

ZhangWeic6a93d50bf1b
diff --git a/packages/sheets-data-validation/src/models/sheet-data-validation-model.ts b/packages/sheets-data-validation/src/models/sheet-data-validation-model.ts
index 574112d019..b34c77dfea 100644
--- a/packages/sheets-data-validation/src/models/sheet-data-validation-model.ts
+++ b/packages/sheets-data-validation/src/models/sheet-data-validation-model.ts
@@ -243,12 +243,13 @@ export class SheetDataValidationModel extends Disposable {
rule
).then((status) => {
const realStatus = status ? DataValidationStatus.VALID : DataValidationStatus.INVALID;
+ const now = cache.getValue(row, col);
if (realStatus === DataValidationStatus.VALID) {
cache.realDeleteValue(row, col);
} else {
cache.setValue(row, col, realStatus);
}
- const now = cache.getValue(row, col);
+
onCompete(realStatus, current !== now);
});
return DataValidationStatus.VALIDATING;