From afa74ebb4b6bf183a7c17d8049f09fd61816456f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 5 Sep 2025 17:16:48 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/15771 --- app/src/plugin/API.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/plugin/API.ts b/app/src/plugin/API.ts index c60114081..c506f84b3 100644 --- a/app/src/plugin/API.ts +++ b/app/src/plugin/API.ts @@ -239,9 +239,8 @@ const getActiveEditor = (wndActive = true) => { let headerElement = item.protyle.model?.parent.headElement; if (!headerElement && item.protyle.element.getBoundingClientRect().height > 0) { const tabBodyElement = item.protyle.element.closest(".fn__flex-1[data-id]"); - const tabId = tabBodyElement.getAttribute("data-id"); - if (tabBodyElement.classList.contains("fn__flex-1") && tabId) { - headerElement = document.querySelector(`.layout-tab-bar .item[data-id="${tabId}"]`); + if (tabBodyElement) { + headerElement = document.querySelector(`.layout-tab-bar .item[data-id="${tabBodyElement.getAttribute("data-id")}"]`); } } if (headerElement) {