Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/11710

Vanessa1513b3d6ecf4
diff --git a/app/src/protyle/render/av/select.ts b/app/src/protyle/render/av/select.ts
index 83bdd3864a..7ac6f725ca 100644
--- a/app/src/protyle/render/av/select.ts
+++ b/app/src/protyle/render/av/select.ts
@@ -179,6 +179,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
}
});
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
+ const oldChipsHeight = menuElement.querySelector(".b3-chips").clientHeight;
if (!cellElements) {
menuElement.innerHTML = getEditHTML({protyle, data, colId, isCustomAttr});
bindEditEvent({protyle, data, menuElement, isCustomAttr, blockID});
@@ -204,7 +205,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
}
- menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
+ menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll + (menuElement.querySelector(".b3-chips").clientHeight - oldChipsHeight);
});
if (menu.isOpen) {
return;
@@ -254,6 +255,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
}
});
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
+ const oldChipsHeight = menuElement.querySelector(".b3-chips").clientHeight;
if (!cellElements) {
menuElement.innerHTML = getEditHTML({protyle, data, colId, isCustomAttr});
bindEditEvent({protyle, data, menuElement, isCustomAttr, blockID});
@@ -279,7 +281,7 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
}
- menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
+ menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll + (menuElement.querySelector(".b3-chips").clientHeight - oldChipsHeight);
});
}
});
@@ -535,10 +537,11 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
menuElement.parentElement.remove();
} else {
const oldScroll = menuElement.querySelector(".b3-menu__items").scrollTop;
+ const oldChipsHeight = menuElement.querySelector(".b3-chips").clientHeight;
menuElement.innerHTML = getSelectHTML(data.view, cellElements);
bindSelectEvent(protyle, data, menuElement, cellElements, blockElement);
menuElement.querySelector("input").focus();
- menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll;
+ menuElement.querySelector(".b3-menu__items").scrollTop = oldScroll + (menuElement.querySelector(".b3-chips").clientHeight - oldChipsHeight);
}
};