An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:bug: Keep mobile navigation hidden during database search
Daniela814a669aafe
diff --git a/app/src/mobile/util/mobileAppUtil.test.ts b/app/src/mobile/util/mobileAppUtil.test.tsindex 55eb36f104..4391151dfe 100644--- a/app/src/mobile/util/mobileAppUtil.test.ts+++ b/app/src/mobile/util/mobileAppUtil.test.ts@@ -65,6 +65,27 @@ describe("mobile input detection", () => {}});+ it("accepts a plaintext database search field and its descendants", () => {+ const databaseElement = createElement({+ attributes: {contenteditable: "false"},+ parentElement: createEditableRoot(),+ });+ const searchElement = createElement({+ attributes: {contenteditable: "plaintext-only", "data-type": "av-search"},+ parentElement: databaseElement,+ });+ const textElement = createElement({tagName: "SPAN", parentElement: searchElement});+ const nonEditableElement = createElement({+ attributes: {contenteditable: "false"},+ parentElement: searchElement,+ });++ assert.equal(canInput(searchElement), searchElement);+ assert.equal(canInput(textElement), searchElement);+ assert.equal(canInput(nonEditableElement), false);+ assert.equal(canInput(databaseElement), false);+ });+it("accepts the editable Protyle root as the active element", () => {const bodyElement = createElement({tagName: "BODY"});const wysiwygElement = createElement({diff --git a/app/src/mobile/util/mobileAppUtil.ts b/app/src/mobile/util/mobileAppUtil.tsindex 3385f457a6..2343ba3304 100644--- a/app/src/mobile/util/mobileAppUtil.ts+++ b/app/src/mobile/util/mobileAppUtil.ts@@ -35,7 +35,7 @@ export const canInput = (element: Element) => {if (wysiwygElement && wysiwygElement.getAttribute("data-readonly") === "false") {// 按最近的编辑边界判断,避免点击不可编辑的渲染区域时唤起键盘并恢复旧光标位置。const editableElement = hasClosestByAttribute(element, "contenteditable", null, true);- return editableElement && editableElement.getAttribute("contenteditable") === "true" && editableElement;+ return editableElement && ["true", "plaintext-only"].includes(editableElement.getAttribute("contenteditable")) && editableElement;}return false;};