From 43ca52f3b8ad1e814d942e55a0f2d0c549314e75 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 28 Oct 2023 17:36:52 +0800 Subject: [PATCH] :art: fix https://github.com/siyuan-note/siyuan/issues/9531 --- app/src/ai/actions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.ts index 6058f19d3..22b32fa58 100644 --- a/app/src/ai/actions.ts +++ b/app/src/ai/actions.ts @@ -50,7 +50,6 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { width: isMobile() ? "92vw" : "520px", }); const nameElement = dialog.element.querySelector("input") - nameElement.focus(); const customElement = dialog.element.querySelector("textarea"); const btnsElement = dialog.element.querySelectorAll(".b3-button"); dialog.bindInput(customElement, () => { @@ -84,6 +83,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { setStorageVal(Constants.LOCAL_AI, window.siyuan.storage[Constants.LOCAL_AI]); dialog.destroy(); }); + nameElement.focus(); } }]; if (window.siyuan.storage[Constants.LOCAL_AI].length > 0) { @@ -113,7 +113,6 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { }); const nameElement = dialog.element.querySelector("input"); nameElement.value = item.name; - nameElement.focus() const customElement = dialog.element.querySelector("textarea"); const btnsElement = dialog.element.querySelectorAll(".b3-button"); dialog.bindInput(customElement, () => { @@ -150,6 +149,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => { }); dialog.destroy(); }); + nameElement.focus() } else { fetchPost("/api/ai/chatGPTWithAction", { ids,