From a82fa8be36c573f4fd5603395d9ad427b195c5c3 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 9 Oct 2025 12:16:30 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12000 --- app/src/protyle/render/av/filter.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/src/protyle/render/av/filter.ts b/app/src/protyle/render/av/filter.ts index 757a36325..ca79a7ba0 100644 --- a/app/src/protyle/render/av/filter.ts +++ b/app/src/protyle/render/av/filter.ts @@ -451,18 +451,18 @@ export const setFilter = async (options: { menu.addItem({ iconHTML: "", type: "readonly", - label: `
`, + label: `
`, bind(element) { const inputElement = element.querySelector("input"); - const listElement = inputElement.nextElementSibling; + const listElement = inputElement.nextElementSibling as HTMLElement; const renderList = () => { fetchPost("/api/av/getAttributeViewPrimaryKeyValues", { - id: options.data.id, + id: colData.relation.avID, keyword: inputElement.value, }, response => { let html = ""; (response.data.rows.values as IAVCellValue[] || []).forEach((item, index) => { - html += `
${item.block.content}
`; + html += `
${item.block.content || window.siyuan.languages.untitled}
`; }); listElement.innerHTML = html; if (html === "") { @@ -470,6 +470,8 @@ export const setFilter = async (options: { } else { listElement.classList.remove("fn__none"); } + const inputRect = inputElement.getBoundingClientRect(); + setPosition(listElement, inputRect.left, inputRect.bottom + 4, inputRect.height + 4); }); }; inputElement.addEventListener("input", (event: KeyboardEvent) => { @@ -650,10 +652,6 @@ export const setFilter = async (options: { } toggleEmpty(operationElement, operationElement.value, filterValue.type); menu.open({x: rectTarget.left, y: rectTarget.bottom}); - if (filterValue.type === "relation") { - const inputRect = textElements[0].getBoundingClientRect(); - textElements[0].nextElementSibling.setAttribute("style", `position:fixed;top:${inputRect.bottom}px;left:${inputRect.left}px`); - } if (textElements.length > 0) { textElements[0].select(); }