Vanessa
2026-06-10 20:42:35 +08:00
parent 9dc4572a45
commit 8cc1baf744
2 changed files with 15 additions and 2 deletions
+4
View File
@@ -139,6 +139,10 @@
overflow: auto hidden;
}
&__spacer {
pointer-events: none;
}
&__row {
display: flex;
border-bottom: 1px solid var(--b3-theme-surface-lighter);
+11 -2
View File
@@ -69,10 +69,19 @@ const doTrim = (blockElement: HTMLElement, elementRect: DOMRect): void => {
firstVisibleIndex = Math.max(0, state.renderedStart - Math.ceil((rect.top - topLimit) / 36));
}
}
const headerElement = bodyEl.querySelector(".av__row--header");
if (!isScrollingUp) {
if (toRemoveAbove.length > 0) {
toRemoveAbove.forEach(row => row.remove());
let removeHeight = 0;
toRemoveAbove.forEach((row) => {
removeHeight += row.getBoundingClientRect().height;
row.remove();
});
if (headerElement.nextElementSibling.classList.contains("av__spacer")) {
headerElement.nextElementSibling.setAttribute("style", `height: ${removeHeight + headerElement.nextElementSibling.getBoundingClientRect().height}px`);
} else {
headerElement.insertAdjacentHTML("afterend", `<div class="av__spacer" style="${removeHeight}px"></div>`);
}
state.renderedStart = state.renderedStart + toRemoveAbove.length;
}
if (lastVisibleIndex > state.renderedEnd) {