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: increase/decrease font size with cell.P (#6274)

Roman Sergeev4cd65e69bc24
diff --git a/packages/sheets-ui/src/controllers/menu/utils.ts b/packages/sheets-ui/src/controllers/menu/utils.ts
index 520a4a7627..0dbd646a16 100644
--- a/packages/sheets-ui/src/controllers/menu/utils.ts
+++ b/packages/sheets-ui/src/controllers/menu/utils.ts
@@ -28,9 +28,11 @@ export function getFontStyleAtCursor(accessor: IAccessor) {
if (editorDataModel == null || activeTextRange == null) return null;
const textRuns = editorDataModel.getBody()?.textRuns;
+
if (textRuns == null) return;
- const { startOffset } = activeTextRange;
- const textRun = textRuns.find(({ st, ed }) => startOffset >= st && startOffset <= ed);
+ const { startOffset, endOffset } = activeTextRange;
+ const textRun = textRuns.find(({ st, ed }) => startOffset >= st && endOffset <= ed);
+
return textRun;
}