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-hyper-link): update hyper link fail (#4057)

zhangw6423ff8ede75
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/custom-formula-input.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/custom-formula-input.tsx
index c250bceac4..3f50e0e727 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/custom-formula-input.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/custom-formula-input.tsx
@@ -49,6 +49,7 @@ export function CustomFormulaInput(props: IFormulaInputProps) {
errorText={formula1Res}
onFocus={() => isFocusFormulaEditorSet(true)}
actions={formulaEditorActionsRef.current}
+ isSupportAcrossSheet
/>
);
}
diff --git a/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx b/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
index 8e61cd7db1..9447de6121 100644
--- a/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
+++ b/packages/sheets-data-validation-ui/src/views/components/formula-input/list-formula-input.tsx
@@ -356,6 +356,7 @@ export function ListFormulaInput(props: IFormulaInputProps) {
errorText={(formula1Res || localError) || undefined}
onFocus={() => isFocusFormulaEditorSet(true)}
actions={formulaEditorActionsRef.current}
+ isSupportAcrossSheet
/>
<div ref={containerRef} style={{ marginTop: '12px' }}>
{refFinalList.map((item) => {
diff --git a/packages/sheets-hyper-link/src/commands/commands/update-hyper-link.command.ts b/packages/sheets-hyper-link/src/commands/commands/update-hyper-link.command.ts
index aa524b728a..fe9e6506ac 100644
--- a/packages/sheets-hyper-link/src/commands/commands/update-hyper-link.command.ts
+++ b/packages/sheets-hyper-link/src/commands/commands/update-hyper-link.command.ts
@@ -45,7 +45,11 @@ export const UpdateHyperLinkCommand: ICommand<IUpdateHyperLinkCommandParams> = {
const hyperLinkModel = accessor.get(HyperLinkModel);
const interceptorService = accessor.get(SheetInterceptorService);
- const target = getSheetCommandTarget(instanceSrv);
+ const target = getSheetCommandTarget(instanceSrv, {
+ unitId: params.unitId,
+ subUnitId: params.subUnitId,
+ });
+
if (!target) return false;
const { payload: link, row, column, id } = params;