mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-01-07 01:00:04 +01:00
Fix jittering while typing on Firefox (closes #7086)
This commit is contained in:
parent
6af3598cfa
commit
e33921a629
|
|
@ -170,6 +170,13 @@ targetElement.addEventListener("scroll", function() {
|
|||
|
||||
// Create a MutationObserver instance
|
||||
const observer = new MutationObserver(function(mutations) {
|
||||
// Check if this is just the scrolling class being toggled
|
||||
const isScrollingClassOnly = mutations.every(mutation =>
|
||||
mutation.type === "attributes" &&
|
||||
mutation.attributeName === "class" &&
|
||||
mutation.target === targetElement
|
||||
);
|
||||
|
||||
if (targetElement.classList.contains("_generating")) {
|
||||
typing.parentNode.classList.add("visible-dots");
|
||||
document.getElementById("stop").style.display = "flex";
|
||||
|
|
@ -182,7 +189,7 @@ const observer = new MutationObserver(function(mutations) {
|
|||
|
||||
doSyntaxHighlighting();
|
||||
|
||||
if (!window.isScrolled && targetElement.scrollTop !== targetElement.scrollHeight) {
|
||||
if (!window.isScrolled && !isScrollingClassOnly && targetElement.scrollTop !== targetElement.scrollHeight) {
|
||||
targetElement.scrollTop = targetElement.scrollHeight;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue