mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-03-17 19:04:39 +01:00
UI: Make autoscroll more robust after the optimizations
This commit is contained in:
parent
24e7e77b55
commit
0cd245bcbb
|
|
@ -181,6 +181,13 @@ const observer = new MutationObserver(function() {
|
|||
typing.parentNode.classList.add("visible-dots");
|
||||
document.getElementById("stop").style.display = "flex";
|
||||
document.getElementById("Generate").style.display = "none";
|
||||
// If the user is near the bottom, ensure auto-scroll is enabled
|
||||
// for the new reply. This catches cases where isScrolled was
|
||||
// incorrectly set to true by layout shifts during page load, etc.
|
||||
const diff = targetElement.scrollHeight - targetElement.clientHeight;
|
||||
if (Math.abs(targetElement.scrollTop - diff) <= 10 || diff <= 0) {
|
||||
window.isScrolled = false;
|
||||
}
|
||||
} else {
|
||||
typing.parentNode.classList.remove("visible-dots");
|
||||
document.getElementById("stop").style.display = "none";
|
||||
|
|
|
|||
Loading…
Reference in a new issue