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(sheet): editor dev

dream-num95b046cdd321
diff --git a/packages/base-render/src/Component/Docs/Document.Editor.ts b/packages/base-render/src/Component/Docs/Document.Editor.ts
index 01f57ee396..212ba52fe3 100644
--- a/packages/base-render/src/Component/Docs/Document.Editor.ts
+++ b/packages/base-render/src/Component/Docs/Document.Editor.ts
@@ -423,7 +423,7 @@ export class DocsEditor {
const anchor = textSelection?.getAnchor();
- if (!anchor) {
+ if (!anchor || (anchor && !anchor.visible)) {
return;
}
diff --git a/packages/core/src/Shared/Common.ts b/packages/core/src/Shared/Common.ts
index f934051a6d..f6c9f39177 100644
--- a/packages/core/src/Shared/Common.ts
+++ b/packages/core/src/Shared/Common.ts
@@ -86,12 +86,15 @@ export function isFormulaString(value: any): boolean {
return Tools.isString(value) && value.indexOf('=') === 0 && value.length > 1;
}
-export function getStyle(styles: Styles, cell: Nullable<ICellData>): IStyleData {
+export function getStyle(
+ styles: Nullable<Styles>,
+ cell: Nullable<ICellData>
+): IStyleData {
let style;
if (cell && Tools.isObject(cell.s)) {
style = cell.s as IStyleData;
} else {
- style = cell && cell.s && styles.get(cell.s);
+ style = cell?.s && styles?.get(cell.s);
}
return style || DEFAULT_STYLES;