diff --git a/app/src/constants.ts b/app/src/constants.ts index 6d2022468..4d60547cc 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -94,7 +94,7 @@ export abstract class Constants { public static readonly CB_GET_ROOTSCROLL = "cb-get-rootscroll"; // 如果为 rootID 就滚动到指定位置,必有 rootID public static readonly CB_GET_HTML = "cb-get-html"; // 直接渲染,不需要再 /api/block/getDocInfo,否则搜索表格无法定位 public static readonly CB_GET_HISTORY = "cb-get-history"; // 历史渲染 - public static readonly CB_GET_OPENNEW = "cb-get-opennew"; // 编辑器只读后新建文件需为临时解锁状态 + public static readonly CB_GET_OPENNEW = "cb-get-opennew"; // 编辑器只读后新建文件需为临时解锁状态 & https://github.com/siyuan-note/siyuan/issues/12197 // localstorage public static readonly LOCAL_ZOOM = "local-zoom"; diff --git a/app/src/protyle/index.ts b/app/src/protyle/index.ts index 8932678b7..81b455a65 100644 --- a/app/src/protyle/index.ts +++ b/app/src/protyle/index.ts @@ -282,7 +282,7 @@ export class Protyle { private afterOnGet(mergedOptions: IOptions) { if (this.protyle.model) { /// #if !MOBILE - if (mergedOptions.action?.includes(Constants.CB_GET_FOCUS)) { + if (mergedOptions.action?.includes(Constants.CB_GET_FOCUS) || mergedOptions.action?.includes(Constants.CB_GET_OPENNEW)) { setPanelFocus(this.protyle.model.element.parentElement.parentElement); } updatePanelByEditor({