fix(编辑能力): 修复搜索焦点抢占问题

This commit is contained in:
xiaoqidun committed 2026-10-29 16:17:41 +08:00
1 parent af80fcc9ba
commit 1a25472b43
1 file changed
+7 -1
+7 -1
View File
@@ -11065,7 +11065,13 @@ function copySelection(event) {
event.preventDefault();
}
function focusSearch() {
async function focusSearch() {
if (canvasEditor.input || canvasEditor.crop || canvasEditor.nudge || canvasEditor.nudgeCommit) {
const tab = documentTab(), content = documentContentKey(state);
const current = () => isForegroundDocument(tab) && content === documentContentKey(state);
if (!await canvasEditor.commitNudge() || !current() || !await canvasEditor.commitText() || !current()
|| !await canvasEditor.commitCrop() || !current() || document.body.hasAttribute("data-busy") || formDialogOpen()) return;
}
if (!state.showPages) {
toggleSidebar("pages");
}