From 1b3ec44e35277b83a0ee6f1d2b9b30ae969ebab0 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 22 Feb 2026 18:22:00 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/17051 --- app/src/protyle/util/table.ts | 5 +++-- app/src/protyle/wysiwyg/index.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/protyle/util/table.ts b/app/src/protyle/util/table.ts index 6778b6cfb..3ed120d6c 100644 --- a/app/src/protyle/util/table.ts +++ b/app/src/protyle/util/table.ts @@ -832,8 +832,6 @@ export const updateTableTitle = (protyle: IProtyle, nodeElement: Element) => { dialog.bindInput(inputElement, () => { (btnsElement[1] as HTMLButtonElement).click(); }); - inputElement.focus(); - inputElement.value = captionElement?.textContent || ""; btnsElement[0].addEventListener("click", () => { dialog.destroy(); }); @@ -857,4 +855,7 @@ export const updateTableTitle = (protyle: IProtyle, nodeElement: Element) => { updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, html); dialog.destroy(); }); + inputElement.value = captionElement?.textContent || ""; + inputElement.focus(); + inputElement.select(); }; diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 45833bb4c..d7a1c4986 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -2666,6 +2666,7 @@ export class WYSIWYG { if (tableElement) { if (hasClosestByTag(event.target, "CAPTION")) { updateTableTitle(protyle, tableElement); + return; } } // 面包屑定位,需至于前,否则 return 的元素就无法进行面包屑定位