mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-26 21:01:16 -03:00
fix(ui): replace smooth scroll with instant for back-to-top to avoid VirtualScroller conflict
The back-to-top button used scrollTo({top:0, behavior:'smooth'}) which
conflicts with VirtualScroller's DOM manipulations during the smooth
scroll animation. Each animation frame triggered handleScroll() ->
scheduleRender() -> renderItems(), causing the browser to interrupt
the smooth scroll animation mid-way, resulting in only ~1 page of
upward scroll instead of reaching the top.
Root cause: commit 311e89e9 fixed VirtualScroller to listen on the
correct scroll container (.page-content), but this meant every scroll
event during smooth animation now triggers expensive DOM operations
that abort the browser's compositor-thread smooth scroll animation.
Fix: use instant scroll (scrollTop = 0) so the position is set
immediately without triggering frame-by-frame VirtualScroller
interference.
This commit is contained in:
@@ -384,12 +384,9 @@ export function initBackToTop() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Smooth scroll to top
|
// Scroll to top
|
||||||
button.addEventListener('click', () => {
|
button.addEventListener('click', () => {
|
||||||
scrollContainer.scrollTo({
|
scrollContainer.scrollTop = 0;
|
||||||
top: 0,
|
|
||||||
behavior: 'smooth'
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Listen for scroll events on the scrollable container
|
// Listen for scroll events on the scrollable container
|
||||||
|
|||||||
Reference in New Issue
Block a user