fix(playground): scroll with vanilla JS

jQuery must burn in fire.
This commit is contained in:
ObserverOfTime 2025-06-15 11:19:29 +03:00
parent 99c121bfe8
commit 0bb43f7afb
2 changed files with 5 additions and 8 deletions

View file

@ -487,12 +487,12 @@ window.initializePlayground = async (opts) => {
const containerHeight = outputContainerScroll.clientHeight;
const offset = treeRowHighlightedIndex * lineHeight;
if (scrollTop > offset - 20) {
$(outputContainerScroll).animate({ scrollTop: offset - 20 }, 150);
outputContainerScroll.scrollTo({ top: offset - 20, behavior: 'smooth' });
} else if (scrollTop < offset + lineHeight + 40 - containerHeight) {
$(outputContainerScroll).animate(
{ scrollTop: offset - containerHeight + 40 },
150,
);
outputContainerScroll.scrollTo({
top: offset - containerHeight + 40,
behavior: 'smooth'
});
}
}
}