mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
3c29719b5d
commit
67384f569e
1 changed files with 6 additions and 2 deletions
|
|
@ -456,6 +456,9 @@ export const setFilter = async (options: {
|
||||||
const inputElement = element.querySelector("input");
|
const inputElement = element.querySelector("input");
|
||||||
const listElement = inputElement.nextElementSibling as HTMLElement;
|
const listElement = inputElement.nextElementSibling as HTMLElement;
|
||||||
const renderList = () => {
|
const renderList = () => {
|
||||||
|
if (!colData.relation || !colData.relation.avID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
fetchPost("/api/av/getAttributeViewPrimaryKeyValues", {
|
fetchPost("/api/av/getAttributeViewPrimaryKeyValues", {
|
||||||
id: colData.relation.avID,
|
id: colData.relation.avID,
|
||||||
keyword: inputElement.value,
|
keyword: inputElement.value,
|
||||||
|
|
@ -503,8 +506,9 @@ export const setFilter = async (options: {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
listElement.addEventListener("click", (event) => {
|
listElement.addEventListener("click", (event) => {
|
||||||
if (hasClosestByClassName(event.target as Element, "b3-list-item")) {
|
const itemElement = hasClosestByClassName(event.target as Element, "b3-list-item");
|
||||||
inputElement.value = listElement.querySelector(".b3-list-item--focus").textContent.replace(/\n/g, " ");
|
if (itemElement) {
|
||||||
|
inputElement.value = itemElement.textContent.replace(/\n/g, " ");
|
||||||
listElement.classList.add("fn__none");
|
listElement.classList.add("fn__none");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue