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(conditional-formatting): create cf rule error (#1969)

Gpound.liuee8f8de7e4ec
diff --git a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
index bb58d72833..195796bda0 100644
--- a/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
+++ b/packages/sheets-conditional-formatting-ui/src/components/panel/rule-edit/index.tsx
@@ -60,11 +60,13 @@ export const RuleEdit = (props: IRuleEditProps) => {
const subUnitId = getSubUnitId(univerInstanceService);
const rangeResult = useRef<IRange[]>(props.rule?.ranges ?? []);
+
const rangeString = useMemo(() => {
let ranges = props.rule?.ranges;
if (!ranges?.length) {
ranges = selectionManagerService.getSelectionRanges() ?? [];
}
+ rangeResult.current = ranges;
if (!ranges?.length) {
return '';
}