From 0dc545607b28e17597fa77bbf863b48980b98c3c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 20 Apr 2026 22:02:23 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/17555 --- app/src/protyle/breadcrumb/action.ts | 2 +- app/src/protyle/breadcrumb/index.ts | 3 +++ app/src/protyle/util/onGet.ts | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/breadcrumb/action.ts b/app/src/protyle/breadcrumb/action.ts index de725a751..2df89cdfc 100644 --- a/app/src/protyle/breadcrumb/action.ts +++ b/app/src/protyle/breadcrumb/action.ts @@ -100,7 +100,7 @@ export const fullscreen = (element: Element, btnElement?: Element) => { }; export const updateReadonly = (target: Element, protyle: IProtyle) => { - if (!window.siyuan.config.readonly) { + if (!window.siyuan.config.readonly && protyle.element.getAttribute("disabled-forever") !== "true") { const isReadonly = target.querySelector("use").getAttribute("xlink:href") !== "#iconUnlock"; if (window.siyuan.config.editor.readOnly) { if (isReadonly) { diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts index 306da0178..7ee24ce91 100644 --- a/app/src/protyle/breadcrumb/index.ts +++ b/app/src/protyle/breadcrumb/index.ts @@ -573,6 +573,9 @@ ${padHTML} } public render(protyle: IProtyle, update = false, nodeElement?: Element | false) { + if (protyle.element.getAttribute("disabled-forever") === "true") { + return; + } /// #if !MOBILE let range: Range; let blockElement: Element; diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index 783522e4f..31d053e22 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -251,7 +251,12 @@ const setHTML = (options: { if (protyle.breadcrumb) { protyle.breadcrumb.element.nextElementSibling.textContent = ""; } - protyle.element.removeAttribute("disabled-forever"); + if (protyle.element.hasAttribute("disabled-forever")) { + if (protyle.wysiwyg.element.getAttribute("custom-sy-readonly") === "false") { + protyle.disabled = false; + } + protyle.element.removeAttribute("disabled-forever"); + } if (options.action.includes(Constants.CB_GET_OPENNEW) && window.siyuan.config.editor.readOnly && !window.siyuan.config.readonly) { enableProtyle(protyle); } else {