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: Prevent mobile database menus from restoring keyboard focus https://github.com/siyuan-note/siyuan/issues/18845
Daniel13c35aef189a
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.tsindex 87e574a4aa..fe33f926b0 100644--- a/app/src/mobile/util/keyboardToolbar.ts+++ b/app/src/mobile/util/keyboardToolbar.ts@@ -993,9 +993,9 @@ export const hideKeyboardToolbarByApp = (preserveSelection = false) => {return result;};-export const activeBlur = () => {+export const activeBlur = (force = false) => {const now = Date.now();- if (now < keyboardLockUntil) {+ if (!force && now < keyboardLockUntil) {console.warn(`activeBlur blocked by lock (remaining: ${keyboardLockUntil - now}ms)`);return;}diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.tsindex 595c3beba4..b366d66bbe 100644--- a/app/src/protyle/render/av/action.ts+++ b/app/src/protyle/render/av/action.ts@@ -650,7 +650,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElereturn true;} else if (target.classList.contains("item") && target.parentElement.classList.contains("layout-tab-bar")) {/// #if MOBILE- activeBlur();+ activeBlur(true);/// #endifif (target.classList.contains("item--focus")) {openViewMenu({protyle, blockElement, element: target});diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.tsindex ee55f54ded..b2a4bb2f5c 100644--- a/app/src/protyle/render/av/cell.ts+++ b/app/src/protyle/render/av/cell.ts@@ -480,7 +480,7 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], typehtml = `<input type="number" spellcheck="false" value="${cellElements[0].firstElementChild.getAttribute("data-content")}" ${style} class="b3-text-field">`;} else {/// #if MOBILE- activeBlur();+ activeBlur(true);/// #endifif (["select", "mSelect"].includes(type)) {if (blockElement.getAttribute("data-rendering") === "true") {diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.tsindex 80fe398f1b..2edbb05fdf 100644--- a/app/src/protyle/render/av/col.ts+++ b/app/src/protyle/render/av/col.ts@@ -904,6 +904,9 @@ export const showAVColumnWidthMenu = (protyle: IProtyle, blockElement: HTMLEleme};export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElement: HTMLElement) => {+ /// #if MOBILE+ activeBlur(true);+ /// #endifconst type = cellElement.getAttribute("data-dtype") as TAVCol;const colId = cellElement.getAttribute("data-col-id");const avID = blockElement.getAttribute("data-av-id");@@ -1434,11 +1437,13 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemeny: cellRect.bottom,h: cellRect.height});+ /// #if !MOBILEconst inputElement = window.siyuan.menus.menu.element.querySelector(".b3-text-field") as HTMLInputElement;if (inputElement) {inputElement.select();inputElement.focus();}+ /// #endif};const removeColByMenu = (options: {@@ -1549,7 +1554,7 @@ const genUpdateColItem = (type: TAVCol, oldType: TAVCol) => {export const addCol = (protyle: IProtyle, blockElement: Element, previousID?: string) => {/// #if MOBILE- activeBlur();+ activeBlur(true);/// #endifconst menu = new Menu(Constants.MENU_AV_HEADER_ADD);const avID = blockElement.getAttribute("data-av-id");