From f34d8022b85d27d4689b3de457d12d158f679fe6 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sat, 20 Sep 2025 15:55:33 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/pull/15876 --- app/src/protyle/render/av/relation.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts index a08082359..8fdd33ffd 100644 --- a/app/src/protyle/render/av/relation.ts +++ b/app/src/protyle/render/av/relation.ts @@ -252,13 +252,13 @@ export const toggleUpdateRelationBtn = (menuItemsElement: HTMLElement, avId: str }; const updateCopyRelatedItems = (menuElement: Element) => { - const inputElement = menuElement.querySelector(".b3-form__icona .b3-text-field"); + const inputElement = menuElement.querySelector(".b3-form__icona .b3-text-field") as HTMLInputElement; if (menuElement.querySelector(".b3-menu__icon.fn__grab")) { inputElement.nextElementSibling.classList.remove("fn__none"); - inputElement.classList.add("b3-form__icona-input"); + inputElement.style.paddingRight = "26px"; } else { inputElement.nextElementSibling.classList.add("fn__none"); - inputElement.classList.remove("b3-form__icona-input"); + inputElement.style.paddingRight = ""; } }; @@ -326,13 +326,14 @@ draggable="true">${genSelectItemHTML({ }); } }); + const refElement = menuElement.querySelector(".popover__block"); menuElement.querySelector(".b3-menu__items").innerHTML = `${selectHTML} ${html} ${keyword ? genSelectItemHTML({ type: "empty", newName: Lute.EscapeHTMLStr(keyword), - text: menuElement.querySelector(".popover__block").outerHTML + text: `${refElement.textContent}`, }) : (html ? "" : genSelectItemHTML({type: "empty"}))}`; menuElement.querySelector(".b3-menu__items .b3-menu__item:not(.fn__none)").classList.add("b3-menu__item--current"); updateCopyRelatedItems(menuElement); @@ -410,7 +411,7 @@ ${html || genSelectItemHTML({type: "empty"})}`; event.stopPropagation(); filterItem(options.menuElement, options.cellElements[0], inputElement.value); }); - updateCopyRelatedItems(options.menuElement) + updateCopyRelatedItems(options.menuElement); options.menuElement.querySelector('[data-type="copyRelatedItems"]').addEventListener("click", () => { let copyText = ""; const selectedElements = options.menuElement.querySelectorAll('.b3-menu__item[draggable="true"]'); @@ -444,9 +445,9 @@ export const getRelationHTML = (data: IAV, cellElements?: HTMLElement[]) => { if (colRelationData && colRelationData.avID) { return `
-
- - +
+ +